function on_input(self, action_id, action)
if action_id == hash("space") then
local item = go.get_id("item")
print(item)
go.set_position(vmath.vector3(0,123,0),item)
end
end
DEBUG:SCRIPT: hash: [10046918326113036017 (unknown)]
ERROR:SCRIPT: /main/Test.script:30: Instance (null) not found
stack traceback:
[C]: in function ‘set_position’
/main/Test.script:30: in function </main/Test.script:24>
Make sure you’re not confusing components and game objects. A tilemap is a component.
Component names in URLs will start with a “#”, like this: “object#tilemap”.
You can’t use go.get_id() on a component, only the game object that it is on.
You can use go.get_position() and go.set_position() with a component URL, they will completely ignore the component part of the URL and act on the game object.
ERROR:SCRIPT: /main/Test.script:29: Instance item not found
stack traceback:
[C]: in function ‘set_position’
/main/Test.script:29: in function </main/Test.script:24>