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.
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.
#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!
Torque Owner janet kim