#Unity2d collision detection does not working

26 messages · Page 1 of 1 (latest)

flint lily
#

The character has to get up with the ball

tropic dove
#

Show the collider component of the ball

flint lily
#

@tropic dove

tropic dove
#

How are you moving the ball

sharp trellis
#

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.

flint lily
#

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));

flint lily
#

Let me get a new record for it

#

it needs to climb

sharp trellis
#

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.

flint lily
#

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

sharp trellis
sharp trellis
flint lily
#

I'll give it a try

#

not with torque btw, rb.MoveRotation

#

torque does not work

#

@sharp trellis

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.

flint lily
#

Thank you