- Home /
Moving Platforms + Third Person Controller
So as you can see my question may be quite simple, but the answer truly seems to be pretty involved. I have been toying around with some basic collision / animation in my environment and have now stumbled upon a whole range of interesting scenarios when dealing with third person vs first person (I'm working with Unity's included controllers) would anyone have a solution for getting this third person to work with my moving platform formula, or should I look to the asset store to purchase a more useful third person controller.
Also let me include my simple moving platform code for reference, this is the code attached to my platform, simple but effective for first person interaction, as for third...it seems my collision is non existent or buggy.
var targetA : GameObject;
var targetB : GameObject;
var speed : float = 0.1;
function FixedUpdate () {
var weight = Mathf.Cos(Time.time * speed * 2 * Mathf.PI) * 0.5 + 0.5;
transform.position = targetA.transform.position * weight
+ targetB.transform.position * (1-weight);
}