- Home /
help in animation/code
I am try to make puzzle game were you need to find paper from book so in each level bit of the book what need to is how can make object when get colse to it it gose and the door open any thing will help thank you
I have no clue what you are asking, please clarify your question.
Are you asking "When I get close to a door, how do I make it play an opening animation"?.
I am really sorry about that use my phone no I need script that when you go colse to object say cube you have to go close to it and the that object then will play door open animation and object be destroyed
I got object cube spin around but when get colse to it open the door and cube will be gone
Answer by murkantilism · Mar 18, 2013 at 06:30 PM
Attach a collider object to the player and the cube. Write a script that you will attach to the cube. The script should check for a collision with a game object with the tag "Player" or whatever your player object is tagged as.
Once the collision occurs, have the animation play using animation.Play();.
Then destroy the cube with Destroy(cube).
sorry I did not now were to start thank you I put some research in to it
No problem, I updated my answer with links to documentation. Start your research with those.
If you feel this answered your question, don't forget to mark as answer.
thank for your help but hit other pot hole but I reserch it be asking thanks