Hello,
My player sprite disappears when I set the game object’s position from an external location. Here the player is supposed to be moved when it hits a trigger. That’s the whole trigger’s script.
local player_pos
function on_message(self, message_id, message, sender)
if message_id == hash("trigger_response") then
if message.other_id == hash("/player.go") then
player_pos = go.get_position("player.go")
go.set_position(vmath.vector3(725, player_pos.y, 0), "player.go")
-- Commenting out above line and it doesn't disappear
-- Tried this: go.set_position(vmath.vector3(725, 150, 0), "player.go")
-- Replacing player_pos.y with an absolute number had no impact
end
end
end
Thanks to toggle_physics_debug I was able to see that my player was still working fine (fully functioning and go.set_position worked), it just doesn’t have a sprite anymore.
There is no line of code in my player script which can disable the player sprite as far as I know. I searched the file after “disable”, no line could disable “.” or “player.sprite”. Additionally I have on_message disable release_input_focus, I still have input focus and I usually disable everything via the game object not the sprite component.