My player is stuck
by Mark Brown · in Torque Game Engine · 11/20/2007 (7:31 am) · 4 replies
I have upgraded to TGE 1.5, but I still have a recurring problem for over a year. My player occasionally gets stuck and will not move. He can look all about, but is frozen to one spot. I implemented a bit of code to get him unstuck and mapped it to the "U" key:
function Unstick(%val)
{
%position = $global_player.getTransform ( );
%position = vectorAdd ( ".2 .2 .75", %position );
$global_player.setTransform ( %position );
}
This works and moves the player up and slightly away from his prior x,y position, but the player still has no motion and is not subject to gravity. The game scene is a 3D maze building. Repeated pressing of the "U" key causes the player to continue up through ceilings and floors and finally into the sky while still being able to look about in all directions.
How to I bring him back to life and subject once again to gravity and motion?
Do I have to remove him and respawn him, and if so, how?
function Unstick(%val)
{
%position = $global_player.getTransform ( );
%position = vectorAdd ( ".2 .2 .75", %position );
$global_player.setTransform ( %position );
}
This works and moves the player up and slightly away from his prior x,y position, but the player still has no motion and is not subject to gravity. The game scene is a 3D maze building. Repeated pressing of the "U" key causes the player to continue up through ceilings and floors and finally into the sky while still being able to look about in all directions.
How to I bring him back to life and subject once again to gravity and motion?
Do I have to remove him and respawn him, and if so, how?
About the author
#3
11/21/2007 (2:04 pm)
Are you using dts objects for your maze with polysoup collisions? I know from some tests that I did that the polysoup code will do this. The player actually get's "cemented" to the object, but if moved off, it moves about just fine.
#4
11/24/2007 (6:23 am)
All of the rooms and room parts are ".dif" files. Some objects in the room may be ".dts" but they are not causing a problem.
Torque Owner Mark Brown
The game plays fine most of the time, but every 100 plays or so, the player gets stuck.