So im following a book tutorial and it has a section about platforming
Apparently it says to get the 2d platforming unity script, but it seems alot of the old things are dead, i just keep get redirected to demos,
Anyways.
I have Target A (Platform 1) And Target B(Platform 2) and a EmptyGameobject(platformgroup) running
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 +
Now the object moves from platform 1 to platform 2, but with the first person controller, nothing seems to happend and im hoping for it “move with the fps player on it”
Im very new to it, thus why following a tutorial book but it seems like that isnt working,
Try placing your script in code tags so it is formatted and looks easier to read.
So you’re falling through the platform or sliding off the side?
The way I create ridable platforms is to make a trigger on the top of the platform that makes the just jumped on player a child of the platform. Then the platform script controls the local y pos of the player. Pretty much all you have to do then is unparent when you jump off the platform.
So OnTriggerEnter OnTriggerStay and OnTriggerExit.
I can’t understand exactly what you are saying but back before I used Unity to make a platform “move” a character, we would just add the platforms velocity onto the players velocity whenever he is colliding with it. The same principle should work in Unity. Or you could just parent the character to the platform whenever he collides with it and detach it when you move off it.