Game Development Community

Player Movement Question

by Temasek Polytechnic · in Torque Game Engine · 01/04/2007 (7:11 pm) · 2 replies

Ok.

My player is controlled by the mouse left button (button0). When it is down, the player will move forward. When it is up, the player will stop moving.

I have a trigger. When the player enters the trigger, i want it to stop moving, so i did this:
function MyTrigger::onEnterTrigger(%this,%trigger,%obj)
{
     moveMap.bind(mouse,button0,noMovement);
}

My noMovement function is just empty. The problem is, when the player enters the trigger, it does not stop. The binding works only when i release the mouse button and click it again (meaning i release it first, then when i press it again, the player does not move)

How can i fix this problem without touching C++?

#1
01/04/2007 (7:55 pm)
You could send a command to the client who enters the trigger to execute these commands:

movebackward(0);
moveright(0);
moveleft(0);
movebackward(0);

This should have the same effect as releasing the mouse button.
#2
01/07/2007 (6:18 am)
Put a physicalzone in the place with the trigger and make the physical zone have velocity 0