Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0

Question

Hi, I re-make the post because nobody answered so I hope someone can give me a answer this time :) For 1 month I've been looking for a script that makes you PLAY a ANIMATION when you press a KEY. And all the scripts that people gave me were... NOT WORKING. I'm not a scripter so I don't want to go deeper inside scripting

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Don't remake a post just simpily bump the post (just post on it saying bump and it will go to the top of the need help section, do not use it to get ur active posts up!

Share this post


Link to post
Share on other sites

  • 0

Please login or register to see this code.

function Update()

{

if(Input.GetKeyDown("r"))

{

// Plays the animation - stops all other animations

animation.Play("your animation name", PlayMode.StopAll);

}

}

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

LOL man when I press the key, my player goes to the limit of the map and I can't move. I had a script that did the same thing, do you know how to fix it :) pls ?

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

Its the animation not the script dude, try to make  the animation child of your player not play it on the main player

Share this post


Link to post
Share on other sites
  • 0

it is the problem of the animation, so because u played that animation, the player goes to the limit of the player. 

 

Edit your animation or make a new one. the position is probably the cause of this problem 

Share this post


Link to post
Share on other sites
  • 0

Ok I've got a new animation. Now, I parent it to what ? My FPC ? My hands that are parented to the main camera of the FPC ? ( I did the animation on the hands of my FPC ?

 

And the script ? I parent it to my FPC ?

Edited by AeronX

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...