Author Message

gorgoil

pt
Posts: 271

Location: Portugal , "Oh Cristiano Ronaldo" Island
Occupation: Valo City Drag Racer/Organizer
Age: 27
V$: 0
#136587   2018-02-02 17:11          
# amilmand : Yes the parent of the particle source should be the map (which is in turn the parent of any car visible on the map so you should be able to get the map reference from the cars code with a getParent call).
You should only create the particle source once and keep a reference to it in the cars code, the car is notified of the map change through a setParent() call
you should override this function and recreate the particle system, and the particle effect if the car is put to another map.
On the animate block or whatever other thread you can update the previously created particle effect by its name if you have created it with a call
particleRef.setSource("particle1", new Vector3(0,1.0,0), 0.01, 0.3, new Vector3(0,4.0,0), 0.0, 1.5, 1000.0, null);
subsequent calls with that name (particle1) will not create a new source but will update the properties of the already present one.

If you'd like (or you think you are stuck on something) post the vehicle code or what you created and I'm sure we can figure it out.

here is the java so you can give a look Link
Just to know that it won't work in your game because there is some codes I've created just for my game version
And I've created it on a track to test because I've tried to create it on Vehicle.java and didn't worked

This post was edited by gorgoil (2018-02-02 17:16, ago)