playMaker

Author Topic: Mouse pick but outside circle  (Read 1123 times)

zorranco

  • Playmaker Newbie
  • *
  • Posts: 44
    • View Profile
Mouse pick but outside circle
« on: February 08, 2016, 11:34:12 AM »
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



« Last Edit: February 08, 2016, 11:50:25 AM by zorranco »

zorranco

  • Playmaker Newbie
  • *
  • Posts: 44
    • View Profile
Re: Mouse pick but outside circle
« Reply #1 on: February 11, 2016, 05:26:11 AM »
Still trying to figure it out :D

Anyone?

zorranco

  • Playmaker Newbie
  • *
  • Posts: 44
    • View Profile
Re: Mouse pick but outside circle
« Reply #2 on: February 15, 2016, 02: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.
« Last Edit: February 15, 2016, 03:24:27 AM by zorranco »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4615
    • View Profile
    • jinxtergames
Re: Mouse pick but outside circle
« Reply #3 on: February 16, 2016, 04: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.