How to make an obtainable object for the player

So I have been trying to figure out exactly how to make it so my player will go towards a fork, it disappears and the player has the fork as a weapon or something. I also want the player to pull out the fork or show an animation by only after obtaining the fork by a specific key or button.

I’ve sort of done this but it’s a bit sloppy I think:

  • Managed to get my player to get to the fork and have it disappear.
  • Got a working animation that I want and which works when you right click the mouse at anytime.

But I simply want to only have the animation for the character with the fork to work once it has obtained the fork. Because at the moment you can right click all you want and the animation of the player changes to just that one frame on an individual animation. Or if you guys have a better method you think that would work then that’d be great. :slight_smile:

I’m not sure how to execute this; and as always, I appreciate any help given. :slight_smile:

-You need a variable, for example a variable named “fork”, with init value = 0
-Then, if you collide with the Fork object, delete the object and set variable “fork” = 1
-Finally, you have to play the player’s fork animation only if variable “fork” = 1

About make all animations selecting a frame from one master-animation: You can make it as you want, so if you think it works fine for you, this is OK :slight_smile:

Thank you for the help, I got it to work. :slight_smile: