- Home /
changing animations on an object without the script.
So, first off, i'm not sure weather to call it a script or not, because it's C#(i'm new to unity programming). But basically, here's what i have
using UnityEngine; using System.Collections;
public class falling : MonoBehaviour {
private void Update ()
{
var dwn = transform.TransformDirection (Vector3.down);
if (Physics.Raycast (transform.position, dwn, 2))
{
print("ground");
}
else
{
print ("air");
}
}
}
So basically what i want to do is replace the "print" statements with an animation change. The problem is that when i put this script on the object with animations, it changes the angels to the point that it doesn't work properly(all it prints is "air", so it's not looking directly down)So my question is, how should i go about setting an animation for an object that the script isn't attached to? I've tried google, and i'm brainstorming to try to think of something. Help would be very much appreciated :) thanks for reading.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Door with two sliding parts problem 0 Answers
Why i can't play animation clip i did ? Tried anything so far. 1 Answer
Sword is Messed Up 1 Answer