Hey guys I need your help, so the little green square is supposed to be moving right why isn't he? :( #programming #gamedev #godot #godotengine
@PumpkinsLinked I don't see a script attached to any of the objects in your scene tree, so I don't think its even running.
The warning you are getting in the log isn't really important, but can sometimes catch when you meant to do more with a function than just run it.
You can turn off the warning, amongst others, in the settings.
@PumpkinsLinked So I think you just need to drag actor.gd onto Player.
@PumpkinsLinked Each object in your tree has a type. The one that looks like a person icon is a KinematicBody2D. That's the player object that I think you are trying to drive with your script.
You can see the node type if you hover over the name in the scene tree.
If your .gd script 'extends' KinematicBody2d, those are the only objects it could be assigned to. In godot every object is of a certain type, and an assigned script is like overriding that specific type with new behavior.
@PumpkinsLinked I'm learning myself so don't get what I'm saying too seriously. I've copied your code and my square moves. I've seen in your third screenshot the script is not attached to anything. Maybe it's that?
@PumpkinsLinked Given the warning, I would bet the move_and_slide calculates the new position, but doesn't apply it to the node
@PumpkinsLinked as far as I can tell from the editor screenshot, you didn't actually apply the Actor.gd script to any node in the scene tree, so the Player is still a default KinematicBody2D and not your custom Actor class. you can just drag the Actor.gd script onto the Player node and it should work
@PumpkinsLinked Did you attach your script to the KinematicBody2D node? The scene tree doesn't show it.
What do I do about thisss :((((