#Unity2d collision detection does not working
26 messages · Page 1 of 1 (latest)
Show the collider component of the ball
How are you moving the ball
Doesn't really matter how it's moved, kinematic Rigidbodies will not register collision events.
That being said, since the orb goes into the ground, checking for trigger events may be a more desirable solution.
Ball has a parent object and parent object placed same position as player.
and the parent object rotating by:
transform.Rotate(new Vector3(0,0, (_rotateRight ? rotate : -rotate) * Time.deltaTime));
When I remove rigidbody it'll get collision but sometimes it pass through again
Let me get a new record for it
without rb
it needs to climb
Oh, if the issue is actually about the orb passing through the ground - you will have to move it with the rigidbody. Changing the position directly (for example through rottion) effectively teleports the object and inherently ignores all physics interactions.
But I'm not rotating the ball,
I'm rotating the parent of the ball that centered in the player
Is it change anything if I add rb to ballrotator
Orb rotator is the parent and orb has nothing to move, just turning with parent
I know.
You are still moving the ball by rotating the parent though.
You can literally see it move.
Not if you keep rotating with transform.Rotate.
If may change something if you were to add a torque to the rigidbody, but I kind doubt that this would yield the desired result.
I'll give it a try
I rotated with rb, but now it does not get player high
not with torque btw, rb.MoveRotation
torque does not work
@sharp trellis
If you want the player to be moved by the orb, that will likely be more complicated. I haven't worked enough with Unity physics to really give proper advice here.
Though my first idea would be to look into joints.
Thank you