News Forums Search Search Results for 'freeze'

Viewing 15 results - 16 through 30 (of 36 total)
  • Author
    Search Results
  • #33926


    Ok, I followed your directions, but it still doesn’t work. When I started the game, the enemies don’t even chase the player. So I changed the detect to censor “eyes”, and they chase the player and then freeze once he is out of sight. Eventually though they don’t even chase him with this change. Also, how do you upload a screenshot without having to put in a URL?

    Sequencer (Repeat Forever)
    -expression(playerPosition == position(varHero))
    -Detect(aspect=”aHero” and aspect variable= player)
    -constraint((varHero == null) && (isSearching == true))
    -Timer(3 seconds)

    • This reply was modified 1 year, 2 months ago by  Jsmucker.
    • This reply was modified 1 year, 2 months ago by  Jsmucker.


    That doesn’t seem to be it. As of now, the enemy sees the player, chases him and then freezes when you disapear from sight and then chases when he sees you again.



    Sigil - that fixed it - thank you, after reverting all my enemy characters (yes they were all prefab instances), the errors went away.

    I do notice some odd behavior though running with the new version. I’m using a fairly standard AI where the enemies start to run towards the player when the player comes within range. I have the vision detection set up to be almost 360 and do not require line of sight. With the previous version it was working perfectly, but with the new version if I approach the enemy from behind he starts to turn towards me and then kinds of freezes jostling between 2 angles but still looking 90 degrees to the side instead of directly at me. The enemy stays stuck like this. If I approach from the front view of the enemy then he correctly runs toward me and starts to attack when within range. Any ideas on what’s going on? I will stay with the previous version until I can get this figured out.



    Hi Prime thanks for the response, first let me say thankyou for making RAIN I don’t know how or why it is free but is GREATLY appreciated!

    It’s a little challenging to isolate and reproduce but I’ll see what I can do. The image above shows the navmesh which has some isolated areas. The Wander script grabs random locations on the mesh and I’m wondering if it is getting a spot in these isolated areas and it can’t reach it? I will create some objects to remove those islands and see what happens.

    I am also getting a complete freeze in Unity at random times, not sure if it is related to the above AOORE but is definitely caused by RAIN as the game will run fine without locking up if the AI are disabled.

    EDIT: Yep it was the isolated areas causing the Agr Out of Range Exceptions. Now to work out why Unity just randomly locks up.

    • This reply was modified 1 year, 4 months ago by  sh0v0r.


    Alright, well let’s make sure we have a few things setup properly before we go:

    If you are using RigidBodies and normal colliders (not CharacterController) then you need to be using a BasicMotor (AIRig -> Foot Button -> Motor Drop Down) for movement. Usually I freeze the XYZ rotation as well otherwise the character can fall over (under the RigidBody -> Constraints -> Freeze Rotation. I do not freeze any of the positions as that will mess with gravity as well as collisions.

    If you are using a CharacterControler then you need to be using a CharacterControllerMotor (AIRig -> Foot Button -> Motor Drop Down). That guy usually handles walking up things etc for you so you shouldn’t have to setup much more.

    That should at least get you several AI that run into each other but don’t overlap. They may still collide into each other, but they should behave a little better. As for navigating AI around each other, you will actually have to handle this in code or through the behavior tree.



    A Unity freeze will almost always mean that there is an infinite loop in code. If you are using the code from one of our early tutorial samples, that may be the problem. Feel free to send us a project that demonstrates the issue and we’ll help fix it.


    I am currently trying to implement a strafing behavior to my AI enemy. I want him to move to a position(just as a cover point) while facing something else (the player, or whatever object needed). However, when a put the position needed into the move function, and set the look at to a different position, the enemy twitches and sometimes freezes in places and jerks back and forth. I also need this to work with a waypoint network system also, and that’s resulting the same. Any suggestions on how to make this work?

    Thanks in advance,



    I think either the script or the RAIN engine itself makes unity freeze.

    Way to replicate freeze:
    1) get detected & hide
    2)vague part -> while he is searching you, make yourself visible & hide a couple of times.
    3)let him hit you -> unity freezes.


    I have not been able to successfully play an animation that has it’s Speed set to a negative number within the AIRig’s Animation panel. It just causes the model to freeze for the duration of the clip. Has anyone else gotten this to work properly?



    I don’t have a perfect setting for navigation mesh cause every situation is different. I found just tweaking settings like cell size can make a difference. Also, creating several navigation graphs allows me to tweak each one differently. Make sure they overlap if you’re going to do this.

    The most likely reason your character is walking through game objects is he has to make his way back to the waypoint path and the static objects have to be included in the layers when generating the navigation mesh so he knows what to avoid. **Also, to keep the character walking over hills, rather than through them, I suggest applying a physics capsule collider and rigidbody. You’ll have to mess with the rigidbody like freeze rotation x and z. (1)

    I can see in the screen shots, your detection has “Require line of site” and “Line of site ignores self” are checked and can detect self is unchecked. Are you detecting the “Form” and is the entity a child of root (parent) game object? This looks correct to me and I can’t see why detect would flip on/off as you say.

    In my videos I just use a plane (not rough terrain) to demonstrate the fundamentals. This is why it’s working for me. There is much to learn and every scenario presents new challenges. Having a good foundation of understanding is key to success. I highly recommend watching and playing along with the videos as designed and demonstrated. Then review the details in the wiki. Once you have a good understanding of how everything works, then branch out to do more complicated stuff.

    Try to create a smooth area in the scene. Move your character there. Set up a waypoint and generate nav mesh. Try testing on a smooth surface. If the issues go away then the most likely cause is the rough terrain. That’s just a matter of tweaking the navigation mesh settings to get the best coverage. Then follow my instruction at (1). Please let me know if any of this helps. If not, try contacting Jester to send them your project (if you can) so they can review. I know they will do their best to get an answer for you.

    • This reply was modified 1 year, 7 months ago by  CodersExpo.

    I have a 2 minute video I posted that shows the issue I’ve posted here, I assume with a bit more clarity.

    I built a WayPoint Route. With a start and end point.

    When working in the behavior tree, I can successfully get it to move around. with a “Choose Patrol Waypoints” (Ping Pong, Loop and One Way work)

    If I use a “Choose Path Waypoints” instead, it fails.

    For the Path, I create a Waypoint Network called “PathOther”, with 3 points. The last waypoint is called “End”
    I set the waypoint Network to “PathOther” I set the path Target to “End”, but it essentially freezes after 1 step.

    Any thoughts?



    OK, this is awesome! Sigil I answered my own question, thanks!

    1. Create a terrain and build a small mound just large enough that the mesh cells don’t cover when generating the navigation mesh. Make sure it goes all the way across the terrain.
    2. Create a navigation mesh for the terrain (my terrain is 50 length by 50 width not to big). Note the entire terrain is covered by the mesh EXCEPT the mound stretching across. This hill has no cell coverage and there is no way around. Effectively separating your character from the other half of this mesh graph.
    3. As Sigil suggested, create two empty game objects. Place each on either side of the mound and make sure they are on the mesh.
    4. Add this script Sigil wrote to each game object.
    5. Select the first game object and drag your navigation rig component into the property field “Our Nav Mesh”. Drag the other gameobject into the property field “Other Link”. Check both game objects have a reference to the nav rig and each other.
    6. Add a character to the scene on one side of the mound on the mesh. Add the RAIN AI component.
    7. Create a waypoint route with one point on one side of the mound and another point on the other side. Select all and drop to surface.
    8. Create a behavior tree and add the waypoint route node. Define the waypoint rig and variable.
    9. Add a child move node and give it the waypoint routes move variable and speed.
    10. Assign this BTAsset to your character.
    11. Regenerate the navigation mesh and run the app.

    Your character will walk off the mesh and to the other side because he now has a link. He will walk through the mound though so you have to…

    1. Add a rigid body and freeze rotation X and Z
    2. Add/adjust a capsule collider

    Now he walks over the hill to get to the other side….sounds like a joke coming on

    Now just for fun, remove the script from both game objects and run it again. Your character is stuck. Awesome help with this script Sigil!


    I’m seeing a freeze with navmesh generation. I’m trying different settings for navigation mesh generation and have a scene that is 1000 by 1000 and the navmesh settings are Cell Size 3, Walkable Radius 5, Walkable Height 0.5, Step Height 1 and with those settings the navmesh generates. If I increase the Step Height to 4 a warning appears:

    aStepHeight must be larger then aWalkableHeight by at least the cell size
    at RAIN.Navigation.NavMesh.RecastNodes.CompactSpanGrid.FindNeighbors (Int32 aWalkableHeight, Int32 aStepHeight) [0x00000] in <filename unknown>:0
    at RAIN.Navigation.NavMesh.RecastProcess.ContourCreator.RecastGrid (RAIN.Navigation.NavMesh.RecastNodes.Point2 aGridSquare, RAIN.Utility.SimpleProfiler aProfiler) [0x00000] in <filename unknown>:0
    at RAIN.Navigation.NavMesh.RecastProcess.ContourCreator.ProcessWorker () [0x00000] in <filename unknown>:0

    And the Navigation Mesh progress bar freezes at around 25% and never completes. Note with these settings the step height is larger than the walkable height by the cell size.



    In your case, you should do the following:

    1) Freeze xyz position and rotation.
    2) gravity doesn’t matter
    3) check Allow 3D Movement and Allow 3D Rotation
    4) Turn off Valid Path Required
    5) Add a graph tag with a value “None” on the AI Navigator - this will keep the AI from trying to use any NavMeshes you might have in the scene.



    UPDATE: I was able to get the AI to move up on the Y axis by setting the Character’s rigibody constraints as follows. X and Y freeze positions checked. X, Y, Z freeze rotation checked. Also, Use Gravity is UNchecked.

    The good is that the character is moving from waypoint to waypoint and up the Y axis to a waypoint. The bad is that it sort of bounces to each waypoint. Also, when it gets to the waypoint in the air it first stops beneath it and then raises.

    I am still looking for help on how to get it to “fly” directly to each waypoint. Help appreciated.

Viewing 15 results - 16 through 30 (of 36 total)