- Home /
How do you create custom animations based on input?
Fore example if I touch a spot on the screen (touchscreen) i want the characters had to swing and hit that spot? If spent several days learning unity and I haven't seen anything would suggest I can do this in unity. Is it possible? are there any tutorials that would help me get started with this?
Answer by AlucardJay · Feb 25, 2013 at 08:01 AM
Disclaimer : this is not an answer to the question (How do you create custom animations based on input?), rather a starting point for the OP to get to the question. For more detail on the actual question, I have posted an answer for similar here : http://answers.unity3d.com/questions/392806/animation-manager.html
From your question, you are a long way off from animation. First start with Input , then Raycast :
http://docs.unity3d.com/Documentation/ScriptReference/Input.html
http://docs.unity3d.com/Documentation/ScriptReference/Physics.Raycast.html
from these 2 Unity Scripting References, you should be able to get an input touch position, raycast from that position and find a world-space coordinate.
Here are some of my answers regarding Raycast and iOS touch input :
Your answer
Follow this Question
Related Questions
EDITOR: How to Change Animation Curve Colors 0 Answers
"getcurve" from a gameobject 0 Answers
Can I make animations snap to a frame? 1 Answer