Floating Debris...not sure if usable for gameplay

I’ve discovered an interesting effect. If you add a rigidbody to your obstacles, check “use gravity” and give it a drag value of 1000 (haven’t tested higher or lower) you get this floating debris effect if you bump into them with your rocket.

2 Likes

This could be really cool if you gave the rocket ship a health value, rather than one impact = game over, then have a level strewn with this debris (looks a little like zero gravity alien architecture with the way you have laid it out!).

3 Likes

You could consider dropping a script onto these to trigger the rotation, speed, direction and include a bit of a random range, thus they could be spinning prior to collision (asteroids perhaps?), and all be different - and different each time you play potentially. :slight_smile:

1 Like

It would be fun to find out, how to just add a bit of random force and let the physics do the rest…hmmm…

I like that idea! By now my levels look more like the inside of a bubbly alien :slight_smile: But I keep this in the back of my head until I get to a point in the course where I might learn how to do this.

1 Like

You could perhaps use the Random.Range method to produce values for the X, Y and Z components of a new Vector3, and then pass that into the Rigidbody.AddForce method.

The Rigidbody would be that of one of your objects in the scene which you want to manipulate, to which you add a script using the above.

Be aware of the inclusive/exclusive differences using Random.Range with floats and ints.

Hope this helps. :slight_smile:


See also;

1 Like

Privacy & Terms