Creating a Grid Vortex

Hey all,

Me and a few guys are currently in development of a game for a project we’re hoping to have out in the next 4 months.

The reason I’m here is to ask for ideas or hints on how to create a visual effect we need for one of our core mechanics. Within a 3D space environment we are looking at creating a vortex effect when the player holds down the left mouse button. It only needs to produce the effect on one plane, I.E the X plane.

At this point I’ve been toying with a lot of different particle effects but none seem to get the effect of a grid thats being pulled down/inwards to the center point of the mouse click.

I was hoping to pick a few peoples brains about ways they might tackle this. Is there any effects in Unity that can achieve this? Is it a mater of animating a plane or model to achieve this effect?

Any ideas are greatly appreciated.

Thanks!

Hrm alpha map being called up when u hold down the mouse button? But that’d just be a static image, might be tricky to do with particles. I will let someone more familiar with graphics step in, but a thought is a thought and who knows it might work for your needs :: )

How about this: When the user clicks the mouse button an “empty” GameObject Prefab is created. This also contains a Sphere Collider. Then something along the lines of this (cue copy-pasta from own project/ docs):

var colliders : Collider[] = Physics.OverlapSphere (pos, radius); //Get every object within your vortex' reach/ radius
for (var hit : Collider in colliders) {
		if (!hit) // No Rigibody Component found
		continue;
	
		if (hit.GetComponent(Rigidbody))
		//Move object towards center/ mouse position with pullSpeed.
                //You can use the distance to determine the hit objects speed, so closer objects move faster.

If the objects also need to rotate in a galaxy-ish disc-way you could use the same distance trick, except for rotationSpeed. You could then use rotateAround(uberCoolVortex) to make them ‘spin’. Hope this helped; good luck! =)

PS: On second thought, maybe it doesn’t even need the Collider. Not sure. xD;
Edit: Pretty sure it doesn’t - it’d probably intervene. Sorry 'bout that.

Thanks for the ideas guys. I’ve gotten a hold of an industry mentor in town and he actually had worked on a game of his own dealing with gravity wells, go figure.

At this point were looking at taking the location of a cursor on a plane when interacted by the player. From there we want to take into account the vertices on the plane within a specific radius, and have the usually invisible texture appear for a moment as it distorts toward the cursor position. It’s mainly a matter of calculating all of the vertices within a specific range of the influenced area and having them act accordingly.

I’m still not quite getting what this effect is meant to be, but if it’s anything like I’m imagining in my head from the description, you might also want to look at Unity’s new cloth simulation. That would probably do 90% of the heavy lifting for you, if you’re after what I think you are visually.

Thanks laurie,

I actually played around with the Cloth a quite a bit, more for fun than anything else. The cloth does simulate the desired effect of a depression being caused on a specific point, however it became to difficult to control the cloths affects after the desired vortex has been created due to the physics of the cloth itself. Also the cloth itself would have to be an extremely large material for our world, therefore probably making it harder to fine tune its characteristics to our liking.

Thanks again everyone.

You could probably use an animated texture in addition to vertex distortion. If you calculate the correct texture offset of the mouse click, the animated texture is always animating to the click. Or, just use an invisible plane to detect the click and instantiate an animation plane at the point of contact, if I’m understanding what you want correctly.

Bryan