Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: emmcd3 on April 17, 2016, 10:29:51 PM
-
Perhaps I have overlooked the answer in search of Playmaker Actions, but what I would like to replicate is in the attached script. The C# script works perfectly fine. It has to be inside an FSM to prevent meltdown! The full script for context is attached. The specific line I'm struggling to find or create in PM is below :
if (Physics.Raycast(myTransform.position + Vector3.up * 0.5f + Vector3.left * 1.5f, ....
So, how would I make it into a PM Action. Thanks much.
-
Can you describe what this script does exactly?
-
Sure.. Based on a trigger event it casts out pre-positioned rays which we create a temporary triangle. We calculate the centroid of the triangle and establish the most suitable Vector3 as the next position to move to. It is not intended to run every frame. That is superfluous. Anyway, I'm merely going to customize a string of Action to suit the purpose.
-
Hi,
it's easy to port such equations to PlayMaker.
myTransform.position + Vector3.up * 0.5f + Vector3.left * 1.5f
1. save the myTransform.position in a FsmVector3
2: use Vector3Multiply and use 0.5
3: use Vector3Operator to add the left vector3 (-1,0,0 : http://docs.unity3d.com/ScriptReference/Vector3-left.html)
4: use Vector3Multiply and use 0.5
that's it. does that make sense?
you "simply" need to cut down the equation and rebuild it within PlayMaker.
Bye,
Jean
Jean