Question by
mjraboy · Apr 17, 2017 at 11:23 AM ·
gameobjectdestroytransform.position
Make an object move from Point A to Point B then back to Point A, and then destroy itself
I'm trying to make a Whack-a-mole game for our project in Game Programming and I need a gameobject to go up, then go down, and then destroy itself. All I can find are those that go continuously but I can't use those since it's like giving the player the chance to hit the object for the second or third time if he/she misses it for the first time the gameobject rises from the hole.
Comment
Answer by Landern · Apr 17, 2017 at 01:27 PM
Why not just animate it in the editor and use the animation event system to destroy/hide/whatever the gameobject once it moves up and down. I'm assuming if it's Whack-a-Mole that you can reuse the animations/prefab for each hole and there are more then one.