Game Development Community

Player Mimic

by Scott Doerrfeld · in Torque Game Engine · 02/07/2007 (6:27 am) · 5 replies

I am trying to add a feature to TGE that will cause one player to mimic another. That is, the "mimic" player will mimic the exact position/orientation of the "target" player.

So, in player.cc, Player::processTick, can I simply use this line to achieve this:

Parent::setTransform(mMimicTargetObject->getTransform());

OR...should I update the move pointer according to the target object's x/y/z/pitch/yaw?

#1
02/07/2007 (7:24 pm)
I would probably use getTransform and setTransform, like you, except I would do it from script for ease of use and dynamic capability.
#2
02/08/2007 (7:30 am)
Ok, let's say I do this from script. How do I update every frame?
#3
02/08/2007 (8:16 am)
Whoa, if it's every frame then you probably do want to jump in the engine. I was thinking you would be doing this at timed intervals, or specific events.
#4
02/08/2007 (10:01 am)
Right, essentially I want one player to be mimicking the other player in perfect synchronization.
#5
02/08/2007 (1:38 pm)
Have you tried your first method yet? setTransform(getTransform())? That's a start, but for S&Gs, you could figure out a way for both entities point to the same moveset, or have both under the same controller.