playMaker

Author Topic: Move one Object with two different force directions. [SOLVED]  (Read 1561 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Hi,

I have an object and I'm using SmoothLookAt to a destination and using AddForce on the local Zaxis to move it.

I was trying to have an object be moved by two different forces. Having one main force directing it to a target and another causing it to deviate from it's natural path. So if the object wanted to go Up but the direction of the secondary force was to the right, the path wouldn't be a straight line but an arch.

The forces work fine and can even be opposite (the secondary force would then act as a break, reducing the object's speed)
The problem I'm facing seems to be that I can only have one SmoothLookAt action in effect.

Any ideas on how I could do this? Maybe there's an action I don't know about, or a way to calculated the middle ground between two directions from the SmoothLookAt?
« Last Edit: August 01, 2014, 02:19:54 PM by MajorIdea »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move one Object with two different force directions.
« Reply #1 on: July 31, 2014, 08:36:17 AM »
Hi,

 what is the link between the look at and the forces you apply? For me, they are two different feature.

applying forces to an object is fine, and yes you can have multiple forces applied from various fsms and it will work fine.

SmoothLookAt controls a transform, which is not like forces, if you want to have several lookat and the system to then make a "average" look at, then you must implement a torque based look at or have one transform per look at that you then apply weight on their rotation to find the average. I strongly recommand the torque based approach tho.

http://wiki.unity3d.com/index.php/TorqueLookRotation

I never experimented concurrent torqueLook, so if you have trouble still let me know.

 Bye,

 Jean

Bye,

 Jean