Game Development Community

Getting an object clientside

by Joshua "The Power Nap" Taylor · in Torque Game Engine · 07/11/2002 (12:43 pm) · 1 replies

I've been working on embedding projectiles into the player and I've encountered a problem.

When a projectile that can embed hits a player, it recives a normal, point, and pointer to the object hit.

If it's anything but a ShapeBase object it just stays put.

If it is a ShapeBase object it is suppose to update it's position in relation to the movement of the player.

To eliminate the apperiance of net-lag, I wanted this update to be clientside.

So in the updatePacket/getPacketUpdate functions I added some code that sent(and recived):

-The Point hit(in ShapeBase space, or player space if you will)

-The Normal(in ShapeBase space)

-The ID of the object

So my question is, how do you get a pointer to an object you have an ID number for?

#1
07/12/2002 (12:52 am)
Try this on the client side:

ShapeBase* obj = static_cast<ShapeBase*>(connection->resolveGhost(ID));

Hope this helps
Alex