- Home /
Continuing movement after animaton on GetButtonUp
I've been creating an air hockey game and I have one problem I can't seem to solve. I have one object with animation and code attached to it.
When I press the button down animation plays, rather it tenses the player object(a bat or however it is called), moves object down two units. And here I have a problem. All of this is done on GetButtonDown, but i want object(that bat) to fire (go forward) after GetButtonUp for 3 units and then return one unit back.
I have done this succesfully with another animation but when bat collides with puck it goes through it and puck stays in place and doesn't move forward.
I want to know is it possible to somehow replace animation with translate or Mathf.Lerp or something else but I can't seem to get it to work. So I would like someone to post a solution on my problem.
If needed I'll post a code so you can see my current progress
Your answer
Follow this Question
Related Questions
How to add physics to an animation? 3 Answers
how could a player (or an object) be moved onto and inside an animated vehicle? 2 Answers
Collision occurring when it should not! Help! 1 Answer
What is the best practice in handling scenes with 100+ rigidbodies and collisions on iOS? 1 Answer
Is there a way to use physics to keep a character from clipping through itself during an animation? 0 Answers