Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: zorranco on February 08, 2016, 01:34:12 PM

Title: Mouse pick but outside circle
Post by: zorranco on February 08, 2016, 01:34:12 PM
Hello, we are trying to develop a top down game were the player always face the mouse cursor (blue circle). This is a simple mouse pick + set position in world space. We don't want the mouse to be too close to the player, yet still have the ability to rotate in an imaginary edge of a circle around the player...I know there is an action Vector3 Clamp Magnitude, but I don't know how to use it since the position is in world space...any help appreciated, all day trying to find an answer lol

(http://i.imgur.com/cxA0aG1.jpg)

Title: Re: Mouse pick but outside circle
Post by: zorranco on February 11, 2016, 07:26:11 AM
Still trying to figure it out :D

Anyone?
Title: Re: Mouse pick but outside circle
Post by: zorranco on February 15, 2016, 04:51:21 AM
We are facing jerky rotation, like you can see in this 60fps video:


I will try to summarize what we have:

-Movement is a simple rigidbody with set velocity, should be no problem because this action is indeed in fixedupdate

-Camera is a smooth follow action, again this should be no problem because this is done in late update

-Rotation is a pickup of the ground layer plus look at. Maybe the problem could be here but I don't know how this could be performed differently.

This happens when the mouse is idle and near to the player, and the player is moving.
Title: Re: Mouse pick but outside circle
Post by: djaydino on February 16, 2016, 06:51:32 AM
Hi,
i am not near a computer atm, but maybe a solution is to have a Circle trigger around the player that will make the player idle when the mouse is inside that trigger.

if that does not work for you, could you show a video where the mouse is further away and does work as supposed to and then go closer until it fails. so i can try to replicate it.