- Home /
Particle collision problem
Hi everybody and thank you in advance,
I'm working on a small mobile game in which the player casts magic spells , these spells are particles that should collide with an enemy and then kill it however when a particle does collide with an enemy the position gets messed up like this
https://gyazo.com/2d40db1394cb82406d73541b9e42c005
When i look at the particle in editor mode (so no collision) it works fine
https://gyazo.com/5d06d9684cef59b93082102f1ffd9a9f
could anybody please tell me what is going on exactly? These are the collision settings
https://gyazo.com/9a9ae0585be37d6e47a120866d3a2667
Again thanks in advance and sorry for the noob question.
Hi, thank you for your quick reply
This has fixed the movement but now the particle wont collide anymore
From your gif, it doesn't look like you need particle collision at all because I assume it's just a tap the screen and check if it's within the enemy's collider, then it triggers the particle effect. As such, just uncheck the collision module, and simply play the effect right on the enemy. The tap and trigger requires a very simple script with Input.Get$$anonymous$$ouseButton(0), RaycastHit(), Camera.main.ScreenPointToRay (Input.mousePosition), Physics.Raycast() and Instantiate(). You can google lot of example codes easily.
I used you answer as inspiration for my solution and it worked :) the projectiles work too i just have a function that gets called at a certain event now that calculates the damage.
Thank you for the quick answer !