Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: agito1987 on September 11, 2017, 07:40:13 AM
-
Hey
I just asked a question about smooth roll movement here on the forum and I thought that I had figured it out.
I wanted smooth movement to rotate my player in a shmup like game on the y axis using a controller.
I use an object in front of the player to roll him to the left and right.
This works great and I get the movement I want.
However my problem now is that when I rotate the player, the smooth look at counters the rotation and treats the object like it’s a head. Not rotating in the z axis (it stays y axis op in world space).
My question now is:
How can I let the look at function adjust to the rotation of the tracked object for the roll?
Or lock the z axes so the object follows only on the y axis?
I tried to set the up vector to always check the world space y of the player and setting the up vector of the smooth look at according. And of course inside of the look at function the up vector y to 1. But this doesn’t work.
Attached an image to clarify what my result right now is and wat I want to achieve.
-
Hi,
you likely need to add a level of indirection with a dummy parent and then your player mesh, so that when you rotate this way, you rotate the child, not the parent, and each gameobject is then responsible for a sub part of the whole player behaviour.
Bye,
Jean
-
Solved this issue by having a separate object with the smooth look at.
Object only goes right and left. Now I use get rotation from that object and use it on the main object with set rotation.
(First I send the gotten rotation float to the main fsm but this dident work, don’t know why =/ )