Game Development Community

Projectile added on client and server

by janet kim · in Torque Game Engine · 05/02/2005 (10:11 am) · 3 replies

I'm trying to figure out what's going on here: I noticed that when the onFire() script function is called, that the projectile.cc onAdd() method is called first from that script and then again from NetConnection::ghostReadPacket(). What's happening here? Is this a client/server thing?

As a test, I tried to change the velocity of the projectile (the one apparently added from onFire) and nothing happened. However, I noticed that the velocity of the registerObject projectile reflected the change.

#1
05/02/2005 (10:51 am)
Ok, so after further investigation, yes, there are two copies being created for server and client. So then is there some way to have the velocity change show up on the client side as well (because I can't see the change)? Or am I totally off-track here?
#2
05/02/2005 (2:53 pm)
Yes, there are two objects. One is a ghost of the other and is the version running on the client. You have to send values over the network if you expect changes to propagate to clients. Check the NetObject docs for more information.
#3
05/04/2005 (12:53 pm)
Thanks Ben... will check it out!