Particles not playing when rocket collides

I followed through with the code to play my particle affects when I collide and I believe the code to be fine as my other collision affects work. However i’ve brought in other assets from online to remodel my rocket to look a more realistic and I think this will be where my problem is. I’ve had to manually add Box colliders to these imported models to make sure they collide, do I need to do a similar thing to ensure they produce the wanted particle affects?
Thanks in advance,
Max

Hi Maximillian,

Welcome to our community! :slight_smile:

Whenever you want to access something via code, you need to reference the objects you want to contol in your code. And if you want a collider to collider with other game objects, you have to assign collider components to the respective game objects.

Whether you use your own assets or assets from the internet does not matter. The visual things don’t have anything to do with the game mechanics.

If something does not work as expected, check your console. NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message to see to which line in your code it is referring. If you exposed a field in the Inspector, make sure that it’s not empty.

Did this help?


See also:

1 Like

Hi Nina,

I’ve managed to work out how to get the particle animation working on my models now.
For anyone else who may have a similar problem it was solved by using this line of code (for the crash animation):

CrashParticles = GameObject.Find(“Explosion Particles”).GetComponent();

Also thanks for the speedy reply, it’s much appreciated :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms