How to reduce players velocity?
by Ben Arsenault · in Torque Game Engine · 10/25/2007 (8:19 pm) · 1 replies
I'm currently working on various weapon sets as add-ons for the Torque based game, Blockland. Right now I am trying to create a weapon that when you shoot someone, it makes them freeze in place for a second. How would I have to code it so that onCollision with the player, the velocity is reduced to 0 for a certian amount of time?
Torque 3D Owner Matthew Jessick
http://www.garagegames.com/mg/forums/result.thread.php?qt=67633
If you didn't mind his shaking a bit if he tried to move thereafter, you could just do this 10 times a second ;).
Otherwise you might have to look into unbinding the movement commands from his action map and then rebinding them later. It could get a bit complicated.
Hopefully someone else will chime in with a better way.
You might look into physical zones. Maybe you could make a small one at the character to affect his velocity then delete it. (Might affect others, or he might move out of it or be bumped out of it or something and escape.)
You could add a mode to the C++ code to enforce this. (Might get some warping in a remote client if you surprise the system this way.)