Hi;
I have just started implementing playmaker so this may seem like a dumb question.. I have an object (a bus) that has a script (patrol) attached. The bus follows a waypoint path. If the bus comes into a collision I want to pause the route and wait until the collision no longer exists, then resume.
In my patrol script, I can pause when I reach a destination but in this case, I want to interrupt it no matter where it is on the path between the waypoint1 and waypoint+1.
The following code is called in the script in the Update()
//move towards the waypoint,
//take the distance into consideration and limiter to how far the agent can move so it wont overshoot it's destination
Vector3 direction=(point-transform.position).normalized;
transform.Translate(direction * Mathf.Min(dist, moveSpeed * Time.deltaTime), Space.World);
In the FSM I think I want to (1) detect collision (Collision Event), (2) set a variable. In script I want to test variable - if true do nothing, if false, do regular code.
How do I pass the variable and reference it from the script. Both the FSM and script are on the same object.
Thanks in Advance!