Game Development Community

Transparent objects in client side only.

by Adam Johnston B · in Torque Game Engine Advanced · 04/10/2008 (2:41 pm) · 1 replies

Hi guys,

I have been searching for a way to make an object transparent (invisible)
only in the client. Imagine a vehicle where the player is mounted and you want to make the
vehicle transparent (but only for you).
I think that maybe there is a pretty simple call I'm missing.
Has somebody done this before?

Thank you.

#1
02/24/2009 (10:53 am)
There isn't a simple call that I know of, but it wouldn't be to hard to do, cause when a client connects you have a list of those clients you can check in any method if the object (this pointer) is a client object and you can get the control object. So all you would have to do is a check to see if the object is the client object then check if the object is the current clients control object and if it all checks out then make sure it isn't render or has a different texture is used or whatever you want to do. If you don't want it to be render just look in the render function for that object and make sure that nothing happens in there mainly that:
mShapeInstance->animate();
mShapeInstance->render();
doesn't get called (this may be different in TGEA, I only did this back in TGE, but it shouldn't be that different).

If you are setting a variable and then check for that variable in the render function make sure that the variable is only set on that client object and that it is never updated to the server and therefore the other clients (pack unpack update as well who you set the variable on).