Simply changing an objects position... [RESOLVED]
by Randy Lutcavich · in Torque X 2D · 08/20/2009 (1:48 am) · 2 replies
How can I move my player (without using the default movement component)?
I'm trying to make it so pressing 'W' will move my player exactly 10 pixels up.
I can't figure anything out using the default movement component, everything seems physics based.
I tried just grabbing the player's position and changing that but it is read only.
I'm trying to make it so pressing 'W' will move my player exactly 10 pixels up.
I can't figure anything out using the default movement component, everything seems physics based.
I tried just grabbing the player's position and changing that but it is read only.
About the author
Recent Threads
#2
My problem either lied in the fact that I was attempting to change just the x value (_sceneObject.Position.X) or the fact that I wasn't creating a new Vector2.
Either way, thanks again Jake!
08/20/2009 (2:15 am)
Both those work, thanks!My problem either lied in the fact that I was attempting to change just the x value (_sceneObject.Position.X) or the fact that I wasn't creating a new Vector2.
Either way, thanks again Jake!
Torque Owner Jake Davis
I simply tried both of the following within the ProcessTick of the default Movement component and they both worked to set the position.
The Vector2 will be the postion that you are moving your object to.