- Home /
Particles Colliding with Triggers
Hello!
So I'm working on a freeze-ray type object in my game right now, in Javascript. What I want it to be able to do is create platforms of ice on top of water. The water itself is a trigger, and when the player enters it, it tells the player to go into "swimming" mode.
Now, the player points and clicks to shoot the freeze-ray at the water surface. I have it so it creates a block of ice wherever it hits. But I'm trying to get it to only create ice when it hits water. However, because the water is a trigger, OnParticleCollision is never called when the particles hit it.
So, my question is, how might I detect collision with the particle system and a trigger object?
Answer by Baste · Oct 29, 2014 at 10:41 PM
You make an invisible box that overlaps with the particle system, and only collides with the water.
Or you raycast along the direction of the particle system, and check what the raycast hits. Pick whatever seems to suit you best, though raycasts has a tendency to hit other things, while the box is pretty much guaranteed to hit.
Your answer
Follow this Question
Related Questions
Getting the position/intersection of collided particles 1 Answer
Particle Collision not detected 1 Answer
Fire Collision detection 1 Answer
Put out fire with water particleSystem 2 Answers