- Home /
Don't know how to Move character with platform underneath.
I made it so that a player when he is on top of the platform he moves with the platform, but is there a way so when i hit the platform from underneath the player will move with the platform/get stuck with it, until I hit a button?
This takes place in a 3d environment, first person character is underneath a moving platform using this tutorial https://www.youtube.com/watch?v=AfwmRYQRsbg
"the following is a trigger box around that of the platform"
void OnTriggerEnter(Collider other){
if (other.tag == "human") {
other.transform.parent = gameObject.transform;
print ("holding");
}
}
void OnTriggerExit(Collider other){
if (other.tag == "human") {
other.transform.parent = null;
print ("out");
}
}
currently have that and have print to help me debug. Essentially from the youtube video be able to jump up and get stuck with the platform and move with it. untill you hit a button. Kinda stuck on where I should go from there, turn off gravity and make the character free floating? Or is there a way to keep the player without something underneath to help him continue to move.
Other interesting notes, if the platform is close to the ground and the player is touching the sides the platform will move the player. Also when the player is touching the ground and the platform is essentially at the character's head, the platform will move the character with the platform. Im trying to get it so if the platform is off the ground when the player jumps up and touches the trigger box he would go with the platform.
Goal: Have a player underneath this moving platform and the player will move with this platform while being under it, and not touching the ground at all.
Thanks!!!
Answer by Sethhalocat · Aug 09, 2015 at 07:50 AM
Actually, you can import the fps character from unity 4 and all you need is a sprint script along with the walking sound. Sorry this is a short answer but there isn't much to it...
I have one of the characters right now, from unity package but it wont attach to the platform from down under also i edited so it shows a better understanding of what im trying to do.
I actually believe that all you need to do is move the character up there but the camera blow the platform so it gives the visual effect of being under ins$$anonymous$$d of actually being above. and if you want you can add your own separate invisible collider by the camera and attach it to the camera as children :D
So essentially move the character up once it hits the trigger box under the platform so the character doesnt fall off but the camera is still in the same place, then with a button press or once the collision ends move the character essentially back to its original position :)?
Now assu$$anonymous$$g i added hands into the mix so you could see some part of the body, will this be ok still?
Your answer
Follow this Question
Related Questions
Skined Cloth 0 Answers
How to get a Character to move with a moving platform ? 6 Answers
My Player dies only when he wants to?!? 1 Answer