Week 6

Artist of the day

Rachel Rossin
video

Snapping in Maya

You can hold the 'v' key to snap to a vertex in Maya like you can in Unity, but maya is going to snap with the control point. To move the control point to and edge or vertex press 'd', then click on the point you want. Now you can move holding v and it will snap the control point to a vertex.

Make a flag day

Make a cube and have it be flag shaped. Use the attribute editor to subdivide - way easier than other methods. Put the pole-edge of the flag at the center of the scene! Not mission critical but it make things a little easier.
xray button loction
x-ray and x-ray joints buttons

Rigging

the character riggins from friday night lights
rigging one bone rigging multiple bones

Skinning

Animating in Maya

once you have a keyframe on the first frame you can use the auto keyframe button (bottom right next to the settings button). Be careful though because it will make keyframes every place you make a change.
unity image with animation

Animating in unity

Animator Controller Variables

The animations controller is a little strange at first. You need to create variables within the controller that you can get at with code. To speed up the animation you need to The code below goes on the flag itself.
Animation Controller
	public GameObject player; 
	Animator anim;
	void Start () {
		anim = GetComponent <Animator>(); 
	}

	void Update () {
		//Debug.Log(Vector3.Distance(transform.position, player.transform.position));
		float dis = Vector3.Distance(transform.position, player.transform.position); 
		if (dis < 30){
		float sp = map(Vector3.Distance(transform.position, player.transform.position), 0, 30, 2.0f, 0.1f); 
		anim.SetFloat("speedvar", sp);	
		}
	}

	float map(float s, float a1, float a2, float b1, float b2)
	{
		return b1 + (s - a1) * (b2 - b1) / (a2 - a1);
	}
 
You might be asking, "Wouldn't it be easier to just set anim.wave.speed directly instead of mucking around with multiplier variables"? Well you know what? I'm getting kind of sick of your sassy back talk! No soup for you!