Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by dtonycristian · Feb 01, 2016 at 03:35 PM · animationnpcplaymakeranimated

Animation Playmaker

Hi there,

I am quite new to Unity so please bear with me. I have a character, a human with three animations: run, air squats and pistol squats). I want to make it run from point A to B in a loop and every time it reaches point A or B it should play either squat animation. Can this be done with Playmaker? If so how? Is there any tutorial on that, I tried on google and did not find anything like this.

Thank you very much!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by reef99 · Mar 13, 2016 at 11:40 PM

It can definitely be done in playmaker.

You will need additional (but free) actions probably, such as navmesh agent actions: https://hutonggames.fogbugz.com/default.asp?W1174

And the mecanim animator controller actions: https://hutonggames.fogbugz.com/?W1031

Then it is a matter of setting up an fsm on the character that triggers the animations.

(eg: set up 2 empty game objects for point a and point b, both with colliders that are marked as triggers, rigid bodies and tagged (eg: "Waypoint").

Setup the character with an animator controller (with the animations all setup so that each transition to a squat; has a trigger as a condition and each transition to a run anim; is on exit time), rigid body, navmesh agent and collider.

Bake a navmesh on your floor (google a tutorial as it is super simple but i always thought it looked complex before having it explained)

Setup the character fsm: state1: use 'set animator trigger' action to set the running animation. Use the 'agent move' or 'set agent destination' to move the caharacter towards point a. Use an on 'trigger event' (triggered on entry to point a, via tag (eg: "waypoint")) action to switch to state 2.

In state 2; set animator trigger again so that it plays the squat animation. Use ' wait' action to stay in the state for the time it takes to squat, then send to state3.

In state 3 copy state 1 but set the nav agent destination to point B. Trigger event by tag again and go to state 4.

In state 4; copy state 2 but use the other squat animation))

Ps: if you want to randomise the squat animation add this state (1.5 and 3.5) below between the run (state1&3) and squat states (2&4):

So states 1.5 and 3.5: use 'random int' action and generate an int variable between 1-2 (so either). Use a compare int action and if equal to 1 go to state 2(squat a) from state1/state3(running states)- if int is higher than 1 go to state 4(squat b).

Haha, hope my ramble is understandable to you as it is a basic idea of how to do it...

Good luck with it, ask me if you need clarification or an expansion on it, as i was trying to summarize lol...

PPS: there are plenty of awesome tutorials on youtube, just have a good search. Also try to come over to the playmaker forums for really playmaker speciffic questions, i find people are more knowledgable on playmaker issues there, while here you can get really good help with unity specific and scripting related issues (at least that is my tactic).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

65 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I trigger two animation 2 Answers

NPC Animation 0 Answers

Cycle NPC animations after certain time has passed 0 Answers

Movement distance per frame providing choppy values 1 Answer

Rigging af 2D character, so the feet is the root 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges