-
Search Results
-
Hello,
I am currently using RAIN for a project, but I am having troubles using it.
My general goal is to have a “car” driving around on my Navigation Network, finding it’s goals. It should drive on the right side. As I set the waypoints of the network in the middle of the street, I thought of making a Custom Action that simply puts the object a little bit to the right. The driving should still be settled with the Standart Action “move”, because why implementing that again?
Well, I already thought of this function to position my object one meter more to the right:
Vector3 rightSide = Vector3.Normalize(new Vector3(ai.Kinematic.Forward.z, ai.Kinematic.Forward.y, -(ai.Kinematic.Forward.x))); Vector3 newPos = ai.Kinematic.Position + rightSide; ai.Kinematic.Position= newPos;
Put this in my Execute()
At first I executed it Parallel to the move knot, returning SUCCESS after doing the calculation once. Everytime it crosses a new waypoint it is set to the right side, but slowly moves towards the line again on its way to the next waypoint. I know why too, because the waypoint is set as a goal, I just changed it’s initial position.
If I execute it several times it’s completely crazy, because it sets itself just more and more right of course.
I rather want it to be more like it does the normal move-Action and then the object will be shown doing it moved a little more to the right. While I don’t interfere with changing the parameter used to calculate the move action.
In standart 3D programming you do this as follows:
while(doThisOverAndOver) {
___Set the object to the left;
___Do your calculation; //rotation, move, whatever
___Set the object to the right;
___Show;
}I just cannot “embed” the move action like this.
I thought ai.Motor.ApplyMotionTransforms (); maybe does the Trick as in:ai.Kinematic.Position= newPos; // set right ai.Motor.ApplyMotionTransforms (); //show? ai.Kinematic.Position= oldPos; // set back
but that’s not it. The update function of showing your transformation is somewhere I don’t know.
I am actually confused about how the Standart Actions work in General. Is there anywhere were I can see the code? Or an overview of the order and what kind of stuff the AI does. The API description aren’t really helpful and it’s hard to find tutorials.I hope you understood my problem, it’s hard to explain.
Thank’s in advance- This topic was modified 5 months, 2 weeks ago by blustrawberri.
In a previous version of RAIN with Unity 4, I found that I had to make visual aspects have a somewhat larger radius than the body they were attached to since I had checked “Line of Sight” on the AI’s visual sensors-when I did this, aspects were almost always detected correctly. In the current version of RAIN with Unity 5, the ability to adjust aspect size is removed, and the ability to select ‘Line of Sight’ on sensors seems to be removed as well-now, the only aspects that are correctly detected are the ones whose prefabs I didn’t change since the upgrade. What could be going on here? What important changes have been made to the way that aspects/sensors work between previous versions of RAIN and the current one?
Thank you!