Game Development Community

Persistent Crouch Under a Solid Platform?

by JayG · in Torque X 2D · 10/27/2010 (5:11 pm) · 2 replies

Using Torque 2D Version 2.0 and TXB Version 2.0 for a school project.

I have a crouch component implemented but for some reason when I'm crouched under a solid platform component and release the crouch key, my player pops back up into his standing position and his head moves right through the solid platform component and he slowly moves out from under the platform. It seems like some type of physics conflict. Basically wondering how I can keep the player in a crouched position under a solid platform even when the player releases the crouch key.

Thanks for any input on this issue.

-J

About the author

Recent Threads


#1
10/27/2010 (5:46 pm)
if you are using an PSK, this could be done using the "ActorHitCeiling" possibility.. Obviously, it would be some intricate code, but I'd say very doable with the PSK. Especially since your player is on the ground, and hitting the cieling at the same time, you should be able to enforce crouching in that scenario.
#2
10/27/2010 (8:37 pm)
Depending on your level designs you may find it's simplest to just tag the area with a trigger that tells the actor it should be crouching - force the actor to crouch regardless of the what the player is doing with the controls.