#Collision not detecting

1 messages · Page 1 of 1 (latest)

proud prism
#

there are few problems here...

fickle trail
#

Show me the floor's inspector too.

#

I want to see if you have done anything different.

proud prism
fickle trail
#

since it seems like you aren't falling through the floor

#

That includes the wall's inspector. I want to see the floor.

proud prism
#

the whole prefab's screenshot for context

fickle trail
#

Is the floor non-uniformly scaled?

#

Primitive colliders behave weirdly if they are rotated while parented to something with non-uniform scale.

#

an example

faint rapids
#

I'm more interested to see what the green box looks like when they select the wall

fickle trail
#

indeed

proud prism
fickle trail
#

That's non-uniform scaling.

#

Click on "GroundTile" and show me its scale.

proud prism
fickle trail
#

ah, okay, I thought I saw this mentioned earlier

faint rapids
#

ah, didnt see it in the thread

proud prism
#

oh wow, yeah, huh, should it have the 1 1 1.3 scale as well?

faint rapids
#

can I see the code for player movement?

#

did you post that somewhere?

fickle trail
proud prism
fickle trail
#

But you said that selecting the wall shows that the box wireframe matches the mesh

#

this makes sense if it's rotated at some multiple of 90 degrees

fickle trail
#

Skewing happens if you are rotated so that your axes don't line up with the parent's axes

proud prism
#

wait so the problem could be in rotation?

faint rapids
#

rb.MovePosition ignores collisions doens't it?

fickle trail
#

does it? i was unsure about that

proud prism
#

HUH

#

NOOOOOOOOO

faint rapids
#

yea because you're moving it to a position

proud prism
#

is translate.position the right way here

#

?

fickle trail
#

no, that'd be more wrong

#

set the velocity of the rigidbody.

faint rapids
#

if you set the velocity it would most likely work

#

i'm not 100% sure on the move position thing

fickle trail
#

I'm pretty sure MovePosition respects collisions as long as you have "is kinematic" unchecked...

proud prism
faint rapids
#

then perhaps it's because they're constantly moving it to the position so it ignores it?

#

I know i've had problems with it in the past and generally just set the velocity nowdays

fickle trail
#

i will go test this.

fickle trail
proud prism
#

it says it accepts pn;y Vector3 values, but im not sure which ones to set there...

#

the player's position?

fickle trail
#

this cube is firmly respecting the wall collider

faint rapids
#

interesting. Well, I've had issues with it myself so thought it would be worth testing

fickle trail
proud prism
#

😭

fickle trail
#

so, basically just calculate forward and horizontal speed without deltaTime and plug those in

proud prism
fickle trail
#

because you want a velocity

#

multiplying by delta time tells you how far you'd go in one frame

faint rapids
#

also do Vector3.ClampMagnitude probably if ur adding and not setting.

fickle trail
#

10 meters per second times 0.1 seconds = 1 meter

#

that is not necessary here

faint rapids
fickle trail
#

the forward speed is unrelated to the player's input

fickle trail
#

if I freeze rotation, then it still works fine

faint rapids
#

as in in an update loop pushing it that direction

fickle trail
#

I did it in FixedUpdate.

stray cradle
fickle trail
#

it's bumping into a mesh collider

faint rapids
#

Interpolation wouldn't affect MovePosition, would it?

fickle trail
#

It shouldn't change the actual physical behavior

faint rapids
#

yea thats what I thought...

#

at a loss then, maybe not enough information

fickle trail
#

i would sanity check this by trying to move the player into the floor

#

and seeing what happens

proud prism
fickle trail
#

The Y axis.

#

Y is up and down.

proud prism
#

oh sorry, i have blender in mind

#

aahh im sorry ive google about velocity but im still confused what to write for the rb.velocity

#

i get that it has to have vector3

proud prism
#

okay so the player goes through the floor as well when i move her down... means the problem resides with player?

fickle trail
#

ah, okay, so that's useful information

#

here's another little thing to test

#

make a cube. add a rigidbody. see what happens.

#

does it also fall through the floor?

proud prism
#

oh yeah, i had this idea as well

#

it collides with evrything

#

*the cube does collide with everything

#

everything BUT the walls -_-