I try to follow this example to embed a Kotlin Script. But if try to use the bindings map in my script
val unit = bindings["unit"] as Entity
I get a syntax error (unresolved reference of bindings) and cannot compile the project (in Intellij I created a kts file for the script). How can I resolve this ?
In the current version on Kotlin you no longer need to use the bindings
map. Just access it as a normal variable (unit
).