Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: hoyoyo80 on July 11, 2019, 01:44:05 AM
-
Hi all,
I think the problem is simple, maybe due to over immersive into developement i get clueless about this.
Let say i have two state.
State 1 - Wait Input key for direction using Get Axis Vector and Smooth Look at
Direction
- Wait for a key down and to turn the direction of the player(Player
Facing) and go to State 2
State 2 - Rotate the player for a certain angle and finished go back to State 1
Here, after go back to State 1,the player dont preserve the new facing angle,instead it goes back to its previous facing direction.
Anyway to override this?
Thanks
-
Hi,
I think, it's because you have two different mode, one is accessing the rotation of the object directly, and the other is incrementaly rotating, so when you switch, you can't keep the rotation as it is. Or you are on one hand changing the look at target, and on the other hand actually rotating the object, which also leads to inconsistency.
the smooth look at should always be active, and then you should only change the target.
Bye,
Jean
-
Hi and thanks to you.
Any detail suggestions to combat the above siuation? It useful if the player move and come with contact an npc/switch and want to face at that direction. 😅
-
Hi,
Sure: I usually do this:
- I create a dummy gameobject that act as the target.
- In user control mode, I rotate this dummy around the character,
- In gameologic control mode, I usually parent or follow another target like the enemy
then my player is only dealing with looking at the dummy, and it do no care about how that dummy moves.
Does that make sense?
Bye,
Jean
-
I kindof get it. But thats mean Get axis vector will use these dummy object as a reference for Smooth Look At Direction?
Thanks for the idea, is kinda lit something😁
-
Hi,
manage to solve but maybe it is not so neat but it is working.
what i did is : every time i use Look At i will use Get Forward Direction action to get new facing vector3 and set the vector3 value of variable that is used in Smooth Look at direction.Now the player wont snap back to previous facing direction before using look at.
But JeanFabre, im interested in your method. Care to come out with tutorial.Its sound like a clever solution.Thanks BTW
-
Hi,
Indeed your solution is absolutely correct, you clearly understood the issue.
I am in catch up mode at the moment, so I can't promess any new tutorials or samples, but bump me in a week or two, I'll likely be in a better position to make a quick sample.
Bye,
Jean