Link2012 Posted December 9, 2012 Share Posted December 9, 2012 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
DiSaMe Posted December 9, 2012 Share Posted December 9, 2012 Try calling setElementCollidableWith in onClientElementStreamIn. Link to comment
Link2012 Posted December 9, 2012 Author Share Posted December 9, 2012 Works, thanks, But explosions still affect the preview vehicle, anyway to disable explosions to physically move my ghost vehicle? Link to comment
DiSaMe Posted December 9, 2012 Share Posted December 9, 2012 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
Link2012 Posted December 9, 2012 Author Share Posted December 9, 2012 Nope, the vehicle shouldn't move. With setElementFrozen the vehicle freeze on the air (while spawning, going to the ground), tried with isVehicleOnGround but it returns true even when the cars touch a bit with the wheel on the ground. Link to comment
DiSaMe Posted December 9, 2012 Share Posted December 9, 2012 Then maybe create it in such position that it would be on the ground? Link to comment
Link2012 Posted December 9, 2012 Author Share Posted December 9, 2012 Yeah, but the position is for different vehicle models for a unique coordinate (tried that center of mass something and it return 0.0) Link to comment
DiSaMe Posted December 9, 2012 Share Posted December 9, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now