- Home /
Calling vector3/Sprite animation/Tutorials
Hey guys im new to this forum but really excited about getting into game development ive got two questions, im only semi fimilar with scripting i understand some of it but most of it eludes my comprehension at the moment and just want a little bit of help with what might seem like a simple script to you?
Also if anyone knows any tutorials about to make a game where you shoot falling object before they hit the ground that would be perfect :D
so heres my scripting problem, im trying to understand raycasting
What frustrates me the most is im not sure how to ask this question other wise i would search through all the forums for the answer basically i want two different animations to play, if the ray cast hits on the left side of the screen i want his left arm to throw if it lands on the right side of the screen i want his right arm to throw?
If you know any good tutorials that are similar to this that would be amazing id rather learn my self then ask for help but like i mentioned im just not sure how to ask the right kind of question :(
Thanks in advance :)
public class AnimationScript: MonoBehaviour {
//calculation variables
private Vector3 tempVector;
private Vector3 tempVector2;
private int i;
//animation variables
public float pokeForce;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
{
if (Input.GetButtonDown("fire1"))
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
if (hit.rigidbody != null)
hit.rigidbody.AddForceAtPosition(ray.direction * pokeForce, hit.point);
if
}
}
}
}
that doesnt quite relate to what im trying to do i have watched it though
Your answer
Follow this Question
Related Questions
Video Tutorial on Othello 2d? 0 Answers
How do I stop sprite animation on last frame? 2 Answers
Shaking Sprite Mechanic/Animation after being hit 0 Answers
Animating bones and the entire skeleton together 0 Answers
Most efficient way to do 2D animation 2 Answers