- Home /
Mouse cursor colliding with particles how ???
how can i get my cursor to collide with particles during run time ?
Answer by FreeTimeDev · Oct 20, 2012 at 02:14 AM
Your cursor doesn't really exist in the "3d world" in your game. I think of it as sitting on top of it.
You'll have to make an object, probably an invisible sphere, and move this with your cursor.
thought so , so make the object follow the cursor at a high speed so even when i instantly drag the cursor across the screen the gameobject will collide with a particle , but then i would need to lengthen the object to give it depth but then it will collide with too many particles at once and when the cursor is moved to the side it will cause the collisions to appear as if they are off my a mile lol i will just add a game object and make it spawn an object that can shoot the particles :) thanks much :)
That's one way to do it, and that would have a separate effect from what I was thinking. If you directly modify the the transform.position of the invisible sphere you'll be using to match the relative position of the cursor there wont be any "following"--every frame that your mouse moves so will your object. Search for moving object with mouse on Unity Answers if you need any further help with that specifically.
Remember you can always make it so your Invisible sphere can only knock away so many particles within a time frame, or turn off/on at specific points and other tricks to try and make it work out. It's not about what you see--it's about what happens. Smoke and mirrors is often what game design is about (imo)