Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by NileSuperRiver · Feb 08, 2014 at 05:46 PM · animationraycast

How to animate this grass off a vertex, and make it move out of the way of the charchter?

This Is a picture of off which point I would like to swing this fern back and forth in a wind sway like animation, I can't figure out how to do this, and I have basic knowledge of the animator. alt text

These images are a demonstration from wind waker, you will notice that the fern/grass pivots off the same point, and move away from the character, I would like to do the same, and I assume one would use ray casting, but I just wanted to get some opinions on it first.

Imgur link: http://imgur.com/a/WpL7H#0

-also one last thing, how can I get rid of the pink thing in the background, it's a left over behavior I Think...

unity 2014-02-07 20-21-22-89.png (237.5 kB)
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 RyanZimmerman87 · Feb 10, 2014 at 02:56 AM

I think the pink thing means you are missing a material or texture, it can't be displayed correctly till you fix that.

Hmm for rotating it away from the player there are a lot of different solutions you could try but I can't think of any off the top of my head which would be worthy of an actual code example.

I would start with a OnTriggerEnter event. You could then retrieve the players transform location by the player's collider, maybe create a new Transform point on the plant's script for the players location.

Ideally you could use a LookAt() with the plant and then play a kind of "Knocked Back" animation, but given that plants can't really LookAt() like an enemy would it's really hard to say if that would look goofy.

If you have the transform point of the player though you could probably do some math to determine which animation to play based on the angle. Math problems specifically like this in programming are not my strong point though so I have no example.

You could even have 4-6 little colliders on the plant and a bool for when the player is in the collider. The colliders could be positioned on all side of the plants and be assigned a number to determine which one is active.

For example collider 1 could be on the north side of plant, if player hits it the plant plays the animation where it gets knocked south. Position 2 could be east, 3 south, 4 west.

Those might be bad solutions but taking a crack at it.

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

20 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

Related Questions

Multiple Cars not working 1 Answer

RayCasting + Animation Problem 0 Answers

Mecanim Animations float til end of animation 1 Answer

How to export MMD model to Unity? 0 Answers

Need help with some OnTrigger Scripting 2 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