News Forums RAIN Sample Projects, How To, and Code Combining Mecanim and RAIN: Part 1

This topic contains 29 replies, has 8 voices, and was last updated by  prime 11 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #12563

    Jester
    Keymaster

    This is a first in a series of videos combining RAIN artificial intelligence engine with Unity Mecanim animations.

    Please post your requests on what you would like to see as the series progresses or if you have any questions/comments. Enjoy!

    Download the project file for the first 4 “Getting Started With RAIN 2.0.10″ video walkthroughs. Also be sure to read up on the Wiki for more specific detail and other examples.

    Mecanim Sample Project

    Part 1: Get Started With RAIN 2.0.10 Video Walkthrough

    Part 2: Get Started With RAIN 2.0.10 Video Walkthrough

    Part 3: Get Started With RAIN 2.0.10 Video Walkthrough

    Part 4: Get Started With RAIN 2.0.10 Video Walkthrough

    • This topic was modified 1 year, 6 months ago by  Jester.
    #12635

    redhawk
    Participant

    I’d like to see you set up 3 AI actions using this. These would include climbing up/down a ladder. Jumping from point A to point B (and back). Jumping to grab top of crate and pull self up (and jump off crate to ground).

    These would be extremely helpful for me.

    #12639

    CodersExpo
    Participant

    Thanks redhawk for the feedback. I think understanding how to switch between animation states and using ‘one shot’ type triggers is key to working with RAIN and Mecanim. I would imagine to get started you would need to set up game objects that could act as a trigger.

    Have you seen the original mecanim tutorial done by Unity and Will Goldstone? See https://www.youtube.com/watch?v=Xx21y9eJq1U

    Will uses game object triggers when the AI run off the end of a box container that causes it to fall and roll. I would imagine you could create a trigger at a ladder that would signal your AI to switch to a climb animation. You could use Entity/Aspects for this too…

    It sounds like a challenge and I may try to do something like this! I need to first make sure some of the basics are covered so people know how to use RAIN with mecanim. Then I can get into more examples with regards to general game development. I would also imagine mecanim IK would be needed and that will take the pro version, something I just don’t have right now :-(

    If you come up with anything I would invite you to share. I’m sure you’re not the only person that would like to see this. Anyway, I’ll try to incorporate what I can in each vid. Thanks!!

    #12665

    Jester
    Keymaster

    Parts of this might be helpful. Let me know.

    #12680

    CodersExpo
    Participant

    Yep I saw this too. He actually took the mecanim video Will did and incorporated RAIN {indie} to do exactly what I was suggesting. Let me know if any of this helps you out redhawk. Thanks Jester!

    #12806

    reecpj
    Participant

    That’s seems a useful video, but in the modern version of RAIN (2.0.11.0) I can’t see a way of doing one-way waypoints in the waypoint network. Also, the behavior editor seems very different to the video. Is there anything you have to do to get an AI to use the waypoints in a waypoint network, rather than the navmesh? I was hoping it would automatically take the network into account when it moved. It may just be my scene that’s wrong. Thanks!

    #28113

    prime
    Keymaster

    RAIN 2 uses Waypoint nodes in the behavior tree. To use a waypoint network, add a “Choose Path Waypoints” node from the Behavior Tree Actions menu. Then put your Move node inside it. Set the Waypoint Network to the name of your waypoint network in the scene (use quotes as “My Network”). Set your Path Target to a variable representing where you’re moving (no quotes for variable names) or set a navigation target (as navigationtarget(“MyTarget”)). Set the Move Variable to the name of the variable that the Move node you added will be moving to. (I usually use moveTarget). Make sure your Move node uses the same variable name.

    That’s for a waypoint network used as a path, which is always “one way”.

    #32006

    digitalD
    Participant

    Is Rain 2 compatible with Unity 4.5.2? I installed Rain in a new project today. When I selected my character and added ‘Create AI’ from the Rain toolbar it adds the attributes to my Inspector, but doesn’t show the Rain Interface or even display AI under my character in the Hierarchy. I loaded Rain 2 before upgrading to Unity 4.5.2 and the interface loaded (and still loads in that project) but the AI doesn’t work in mecanim or legacy animation modes. Back to the new project again. I can download and install Rain2, but cannot access the interface. Is Rain2 compatible with Unity 4.5.2?

    #32007

    digitalD
    Participant

    Ok! The interface loaded on about the fourth attempt! Thanks!

    #33104

    Ramsh
    Participant

    I happy that you do these tutorials, but not you should maybe get professionals to do the tutorials because you just make things confusing. Most of the time I’m just working out what you doing as appose to what your saying on the videos… OK maybe it’s just me, I’m sorry but I hope I’m not the only one?

    Otherwise I eventual………………………………………………………………..ly get it working…

    #33111

    prime
    Keymaster

    @Ramsh - If you have specific questions related to the tutorials or topics covered in them, feel free to post the questions on the forums here to get them answered.

    #33112

    prime
    Keymaster

    Quick note though - the RAIN/Mecanim tutorials are outdated. We’ll get new versions done as soon as we can get to it.

    #34083

    Makarios
    Participant

    nevermind, found solution to my question by realizing there were version differences and the root motion checkbox now exists in rain

    Thanks anyways :)

    • This reply was modified 11 months, 2 weeks ago by  Makarios.
    • This reply was modified 11 months, 2 weeks ago by  Makarios.
    • This reply was modified 11 months, 2 weeks ago by  Makarios.
    #34088

    Makarios
    Participant

    quickly ran into another problem, in the new version of rain when I’m doing this tutorial, if i apply root motion in both places (the model and the ai), he moves perfectly, but he doesnt follow the waypoints any longer

    any suggestions?

    #34089

    prime
    Keymaster

    Your AI just walks straight?

    Are you using turning animations with your root motion?

Viewing 15 posts - 1 through 15 (of 30 total)

You must be logged in to reply to this topic.