News Forums RAIN General Discussion and Troubleshooting Waypoint Network + User touch position

This topic contains 0 replies, has 1 voice, and was last updated by  Programlocura 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #40837

    Programlocura
    Participant

    Hi there!

    I’m new using RAIN, i’ve downloaded a few days ago and i’m trying to do some stuff. I’ve seen a lot of video tutorials and read some of the tutorials, but i’m lost anyway.

    In my game i’ve a map (World map). This map has a route in it. There are 10 locations in the game, the user can interact with it simply by touching it and going to that point. For this i’ve created a Waypoint Network.

    I’ve the index of the waypoint i must going to, so, i retrive the position of it, using this:

    Vector3 _destination = navTargets.Waypoints[waypointIndex-1].position;

    Asign to a internal RAIN variable:

    _carAI.AI.WorkingMemory.SetItem<Vector3>("carMovePoint", _destination);

    And then:

    _carAI.AI.Motor.MoveTarget = new RAIN.Motion.MoveLookTarget(){VectorTarget = _destination}; _carAI.AI.Motor.UpdateMotionTransforms();
    _carAI.AI.Motor.MoveTo(_destination);

    My BT looks like this:
    BT (GoToSpecificPoint)
    - SEQ
    - waypointpath
    - Waypoint Network: Waypoint Network
    - Move Target Variable: carMovePoint
    - Move (As a child of waypointpath)
    - Move Target: carMovePoint

    If i move the “Move” action outside of the “waypointpath” the car moves to the point, but not taking in consideration the Waypoint network.

    Can you please orient me in the right direction?

    Sorry for the long post.
    Thanks in advance.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.