Instantiated objects + collision + mess

Hey guys,

I’ve bumped into a problem and I can’t seem to solve it. It’s probably extremely simple and trivial, but I can’t even see the problem.

I have an object with a simple static collider moving. I then instantiate another object in front of it with both a static collider and a rigidbody.

Now what I want is to make the moving object stop, but I can’t even get the collision to register. I’ve tried literally everything I could think of (playing around with the components attached to the objects, where the scripts are and to whom they refer, using simple collision and trigger events), but I can’t even get a single Debug.log message to appear.

However, sometimes I can get the collision to register (as far as I can tell, when I spawn the stationary object on top of the moving one, not letting the moving one simply hit it).

Any ideas?

try adding a rigidbody to the moving object, and adjusting it’s velocity instead of translating it.

So you can reset a rigidbody with this:

rigidbody.velocity = Vector3.zero;
rigidbody.angularVelocity = Vector3.zero;
rigidbody.sleep( );

Attach this sript to the object that you want to reset so it wont move it stops.

realm_1

Hmmm… I think I would adjust the velocity, and not put it to sleep. Try this:

rigidbody.velocity = transform.TransfromDirection(localizedMoveAmount);
rigidbody.angularVelocity=Vector3.zero;