#Collision not detecting
1 messages · Page 1 of 1 (latest)
Show me the floor's inspector too.
I want to see if you have done anything different.
here are screenshots of the walls inspector and player's inpector#💻┃code-beginner message
since it seems like you aren't falling through the floor
That includes the wall's inspector. I want to see the floor.
a video of what's happening: https://streamable.com/vuubmi
the whole prefab's screenshot for context
Is the floor non-uniformly scaled?
Primitive colliders behave weirdly if they are rotated while parented to something with non-uniform scale.
an example
I'm more interested to see what the green box looks like when they select the wall
indeed
huh im not sure honestly, i dont really know what uniformly-scaled exactly is
See how the Scale up here is 1, 1, 1.3 ?
That's non-uniform scaling.
Click on "GroundTile" and show me its scale.
it fits the wall perfectly, we had alreayd discussed it
ah, okay, I thought I saw this mentioned earlier
ah, didnt see it in the thread
oh wow, yeah, huh, should it have the 1 1 1.3 scale as well?
No. It is non-uniform, though, so it could cause colliders to skew a little.
yeah no sorry did not paste it here but the walls and wall colliders fit perfectly
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
Skewing happens if you are rotated so that your axes don't line up with the parent's axes
wait so the problem could be in rotation?
rb.MovePosition ignores collisions doens't it?
does it? i was unsure about that
yea because you're moving it to a position
if you set the velocity it would most likely work
i'm not 100% sure on the move position thing
I'm pretty sure MovePosition respects collisions as long as you have "is kinematic" unchecked...
it is unchecked
rb.velocity.Set() ?
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
i will go test this.
no, literally just rb.velocity = ...
it says it accepts pn;y Vector3 values, but im not sure which ones to set there...
the player's position?
tested. works fine.
this cube is firmly respecting the wall collider
interesting. Well, I've had issues with it myself so thought it would be worth testing
you would tell it how fast you want to go
ðŸ˜
so, basically just calculate forward and horizontal speed without deltaTime and plug those in
why without the delta time though?
because you want a velocity
multiplying by delta time tells you how far you'd go in one frame
also do Vector3.ClampMagnitude probably if ur adding and not setting.
100% rb.MovePosition is making it rest against the wall like that??
the forward speed is unrelated to the player's input
yes.
if I freeze rotation, then it still works fine
as in in an update loop pushing it that direction
I did it in FixedUpdate.
MovePosition does respect collisions
But it can cause issues if too fast and the rb isn't set right
it's bumping into a mesh collider
Interpolation wouldn't affect MovePosition, would it?
It shouldn't change the actual physical behavior
i would sanity check this by trying to move the player into the floor
and seeing what happens
you mean move it down on the Z axis?
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
okay so the player goes through the floor as well when i move her down... means the problem resides with player?