News Forums RAIN General Discussion and Troubleshooting RAIN remove automatically Variables from Memory

This topic contains 1 reply, has 2 voices, and was last updated by  Alvraro 2 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40530

    Proktologe21
    Participant

    Hi, I try to store a Vector3 in the Memory of a AI. This Vector3 is the Position of a Player. The AI should use this Vector3 in this moment when the player is out of viewfield (Player try to hide behinde a wall or runs far away). The AI should move to this point in the world and wait there for a few seconds. After waiting it should go back to the Patrol Route. And the Vector3 can then be deleted from the Ai Memory.

    How can i store a Vector3 in the Memory for longer time? I save the Vector3 with a coustom Action after i call “detect” (to detect the Player) is successful. But if the Player out of sight the Vector3 is deleted immediately.

    #40534

    Alvraro
    Participant

    Hi:

    hmmm If I’m understanding right I think the problem is that each call to your Node “detect player” resets the variable, e.g. “volatilePos”, where you store the Vector3.

    You may try inserting an Expression node right after “detect player” to store volatilePosition’s value in a different variable, e.g. “persistentPos”, which won’t be reset unless, ofc, the node is called next frame. You may also add a condition decorator over your Expression node to avoid re-setting persistentPos if you don’t want to (for example if “detect player” didn’t detect anything).

    Hope it helps!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.