Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Pawel on April 27, 2013, 05:43:22 PM

Title: Look At and Move towards problems...[SOLVED]
Post by: Pawel on April 27, 2013, 05:43:22 PM
Is there a way that when using "smooth look at" and "move towards" actions, once the task is accomplished the character does not go back to previous position or facing direction?

Also, I keep getting those errors when I use "Smooth Look at":
------------------
Look rotation viewing vector is zero
UnityEngine.Quaternion:LookRotation(Vector3, Vector3)
HutongGames.PlayMaker.Actions.SmoothLookAt:DoSmoothLookAt() (at Assets/PlayMaker/Actions/SmoothLookAt.cs:114)
HutongGames.PlayMaker.Actions.SmoothLookAt:OnLateUpdate() (at Assets/PlayMaker/Actions/SmoothLookAt.cs:64)
HutongGames.PlayMaker.FsmState:OnLateUpdate()
HutongGames.PlayMaker.Fsm:LateUpdateState(FsmState)
HutongGames.PlayMaker.Fsm:LateUpdate()
PlayMakerFSM:LateUpdate()
-----------------
Title: Re: Look At and Move towards problems...
Post by: Pawel on April 28, 2013, 09:10:07 AM
I've made the errors go away by changing the SmoothLookAt.cs setting of
diff.sqrMagnitude to "> .001" instead of "> 0"

I still am not sure how can I disable the two scripts from going back to initial position after completing the task...
Title: Re: Look At and Move towards problems...
Post by: jeanfabre on May 13, 2013, 05:47:04 AM
Hi,

 Can you not exit the state and manual set the position then?

bye,

 Jean
Title: Re: Look At and Move towards problems...
Post by: Pawel on May 21, 2013, 07:03:02 PM
Sorry for the long delay.

I am using the "move towards" and "look at" to control a character in the game that waits for, and responds to changes in target position. (Not controlled by the player). Right now, the character goes back to the original position once it reaches the target and the target doesn't move. I would rather have him stay there and wait for any position changes of the target...

Hmm... Maybe you are right. Maybe I could just tell the character to stay in place and wait for any changes of the target.

 
Title: Re: Look At and Move towards problems...
Post by: sebaslive on February 10, 2015, 02:53:38 PM
I've made the errors go away by changing the SmoothLookAt.cs setting of
diff.sqrMagnitude to "> .001" instead of "> 0"

Thank you for this.