News Forums Search Search Results for 'stop moving'

Viewing 9 results - 91 through 99 (of 99 total)
  • Author
    Search Results

  • forthex
    Participant

    From my understanding, when an AI is moving to a target, using BasicMotor, it’s doing so at a constant speed until it’s within the specified close-enough distance, and then abruptly stops.

    Are there plans to add in linear acceleration (or other motion easing, as seen here) so that my AI characters can move a little more naturally?

    Or should I just try to make my own Motor class and override BasicMotor?

    #4915

    In reply to: Intermittent stopping


    RodentGames
    Participant

    *sigh*.. comedy of errors. Turns out I figured out the problem with my pivot points on generation of the NPC as you see above. The new problem turned out to be that I moved my waypoints and they were no longer grounded which caused the AI to just stop short, but unlike in Seinfeld it wasn’t a good move. At least now my dynamically generated NPCs are moving properly you’ll probably see more silly mistakes and questions as I work out the logic!

    #4854

    In reply to: Intermittent stopping


    RodentGames
    Participant

    I decided to follow up on this discussion instead of the other because the subject is more appropriate. I am having a problem of intermittent stopping. My AI attached to a GameObject with it’s pivot point on the ground however the AI seems to get stuck. If I use the Scene editor and move the waypoint the AI is moving towards he’ll get moving again (usually to the next node as he gets stuck just before reaching the node) or if I move the AI slightly he will get moving again. I’ve tried playing with the distance check in the move action without any luck (though I haven’t tried a distance of like 25 or anything yet).

    I would attach a project however this is a networked game with a database system and it would be impossibly large to provide that. A few things to note, this is just a Waypoint Route on a Unity Terrain with no nav mesh attached. Any suggestions or questions?

    #4814

    In reply to: Mecanim Animations


    Pax
    Participant

    Thanks for the reply.
    -

    I did set both of these, so they should be correct. I did however have another AI system that was overriding the root motion, so when I removed that it did work a bit better. It still slides slightly however, so I was trying to tinker with the ‘Use Root Motion’ setting in RAIN, but the AI stopped moving at all and sometimes twitched like crazy. The ‘AngularSpeed’ (‘Param Rotation Speed’) bounced from min to max multiple times a second, and would possibly therefor not move. The animations are animated to move offspot, so from how I see it, unless I’ve misunderstood something, it should be able to use the Root motion to make it move.
    -

    Looking forward to watching the Mecanim video.

    #4809

    kubos
    Participant

    Kinda typed that in fast sorry. I wanted to ask when my ai (enemy) reaches player how do i make it stop moving and start an attack animation and send message back to player then resume on moving if player moves away.

    My tree behaviour :

    —Root
    -Par(never)
    - detect (forever)
    - move (never)
    - animate (never)

    Model’s default animation is looped idle so when it stands it just plays that. I guess its correct.

    Thank you for your advice

    #4705

    Redofpaw
    Participant

    Right, so I’ve altered my Green Cube script so that when the character reaches it it then teleports outside it’s detector range. I didn’t want to destroy it and instantiate it as that would cause all kinds of problems.

    -The character now will move on a right click to where you click, using detect and animating via Mecanim.

    -It will reach there while navigating the Navmesh.

    -If it reaches the target click it will stop.

    -If it is not moving (because the move target is out of range) it is looking out for enemies.

    -If it sees an enemy it will enact the behaviour in that loop (shooting, but yet to be added).

    -If you right click again the move-target object will return and it will stop shooting and will go to wherever you click, thus starting the process again.

    This is basically the problem solved!

    This implementation also allows me to add in extra player controlled characters, which I will have select with a left click (and move with the right).

    I am really liking the new setup of sensors - it really improves the workflow.

    If you do have a BT-centric method to achieve this behaviour then that would be great to know.

    Thanks!

    • This reply was modified 2 years, 3 months ago by  Redofpaw.
    #4698

    Redofpaw
    Participant

    Ok, so I see progress, however the choices are about what the ‘distraction’ is.

    Either it’s the cube the player controls (the green one) - telling the character where to go - or it’s the enemy cube (red).

    If it’s the green cube then it never attacks the red cube because it’s still ‘distracted’ by the green.

    If it’s the red cube then it will stop chasing the green cube if it sees the enemy.

    What would be best if is it can reach the green cube and THEN attack any enemies (red cubes) it sees.

    #4662

    Redofpaw
    Participant

    Ack… I just can’t seem to get it right.

    Trying to figure out what decisions/tree I should be using. A simple detect/move tree works great, but as soon as I try ‘until succeed’ or variations thereof it stops working.

    It seems it should be:
    .
    .
    Root
    -Seq
    —-Seq(until success)
    ——Detect(Never)
    ——Move(Forever)
    —-Seq(After the above succeeds it goes to this one)
    ——Other Behaviour
    .
    .
    Yet it won’t ‘succeed’. It just stays in the first Detect/Move loop.

    If I stick a PAR instead of the first SEQ (just after root) then I get a mix of the Detect/Move and the Other Behaviour. Which is not really what I need

    Any ideas?

    • This reply was modified 2 years, 3 months ago by  Redofpaw.
    • This reply was modified 2 years, 3 months ago by  Redofpaw.

    Redofpaw
    Participant

    Great work, guys! Really impressed with the new setup.

    I have my character, mecanim animated, now following around a cube (which is controlled by the player), which comes to a stop when it reaches the cube. So far so good. What I want is to go into a new ‘loop’ when it is not moving.

    So… if it is NOT moving, it will detect for a Enemy and then shoot at it.

    I suspect these two run in parallel, with the ‘shoot enemy’ script taking over if it is NOT moving AND detects an enemy in range.

    What should the custom action be for calculating “am I moving” and how does it interact with the behaviour tree (what should it return to fail the loop and stick with the ‘follow green cube’ script?

    Thanks!

Viewing 9 results - 91 through 99 (of 99 total)