Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on February 02, 2020, 08:34:30 AM
-
Hi all,
After searching for days, regarding this matter, found similar problem but unclear solution so i beg for your help ;D
im taking some rest from main project and try to make 2d topdown shooter control(just the control, for now)
I manage to move the sprite with left analogue stick, in hierarchy the player has
empty as parent,then the sprite as child. I manage to move the parent and now i want to make the sprite(child) to look the direction that the right analog is pointing.What action(s) should i look into?
Thanks
-
bump for my own topic:
I manage to get input for the right stick, but unable to get the right rotation for my sprite.
I use get axis vector(using XY plane,relative to Camera), convert vector3 to vector 2 and use smooth look at 2d. It doesnt really point to right analogue direction.
Help pls.Thanks
-
Hi,
you need the action LookAtDirection for this, take the right joystick x and y value, make it a vector, that's your direction, then use LookAtDirection to look at that direction.
have you tried that?
worse case, you can make a dummy as sibling of your player, and your move that dummy in self space based on the joystick value, which essentially is going to give you the target to use with a regular look at action.
Bye,
Jean
-
using dummy sprite that set its position as right analogue work like charm ;D
But is there anyway to maintain its position after i release the right analogue stick? Any action to check this?
Thanks A Millions:)
-
Hi,
yes, only update the position of the dummy if the joystick is down with a pointer or the mouse, and so as you release, it will stay at the last position.
Bye,
Jean