Jump to content

Ghost preview vehicle (client)


Link2012

Recommended Posts

How can I make a client vehicle (that is, created client-side, visible only for the client) ghost for collision with other elements?

This vehicles is a preview vehicle and I don't want others disturbing the preview.

Actually when some guy hits the preview vehicle the guy that hitted it doesn't feels nothing (since there's no vehicle for the guy) and for me that see the preview vehicle, the vehicle flies off from the collision.

I tried setElementCollisionsEnabled, but the vehicle starts floating right after the spawn, My next try should be maybe setElementCollidableWith with all the players\vehicles present in game, but what if another vehicle get spawned?

How can I make my client vehicle uncollidable?

Link to comment

Is that vehicle supposed to move at all? If it needs to always be in the same place, then you can use setElementFrozen to lock it in the place, but if you want it to drive without being affected by anything, then I don't have an idea how to achieve it.

Link to comment

That's probably because the model isn't loaded right after the creation of element. Maybe it will return correct value in onClientElementStreamIn. If it doesn't, then you could check its value every frame (onClientPreRender/onClientRender) and when it returns a non-zero value, set the position and freeze the vehicle.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...