fluffysquirrels / GGJ2015

0 stars 0 forks source link

Player can move through wall if collision volume is not clamped to grid unit size #1

Closed NumT closed 9 years ago

NumT commented 9 years ago

This is currently the case on Level1 if you move up to the back wall. It is a result of the position clamp fix forcing the player through the wall meaning that Unity temporarily disregards collisions between the player and the wall - allowing the player to escape. I simple fix for now is to ensure that all art assets adhere to the unit grid layout.

fluffysquirrels commented 9 years ago

I'm not quite clear on how to reproduce this. Can you show a video or an annotated screenshot demonstrating which wall to jump over?

NumT commented 9 years ago

Sure - will do at 12, I'll update you then....

NumT commented 9 years ago

Uploaded a video to /testing

fluffysquirrels commented 9 years ago

Ah! Got it. I thought you meant the bottom left edge / wall. I especially like when the player crouches at the end and falls into infinity!

I'll take a look at why this is happening and try to stop it.

NumT commented 9 years ago

Haha. I think I know why - it's kind of my fault but possibly unavoidable in a way (the fix being to fix the art and collision volumes). At the moment the collision geometry of the level prevents the player from intersecting it (due to the rigid body with isKinematic ticked on the player object). However if you adjust the transform through code (er.... significantly on a single frame I guess?) as we are currently (and necessarily) with my clamp position function then you can force the volumes to intersect. On the next FixedUpdate the collision system will then ignore collisions from intersecting volumes so the player can then escape. All because I hastily modelled the environment and have messed up the size!

I guess this can be fixed from an art standpoint but we could possibly prevent it from happening from a code stand point as well? By snapping the player BACK to the previous square or something along those lines? We definitely do not want to allow the player to not adhere to the grid system as then nothing works well.

NumT commented 9 years ago

Oops didn't realise you can only assign one person at a time? I'll reassign you for now...

NumT commented 9 years ago

Fixed environment model - you'll need to pull as I had to update the Level1 scene as a result!

NumT commented 9 years ago

Not sure whether to close this one for now?

fluffysquirrels commented 9 years ago

Just tested this after your fix. I tried to hop through all four walls of the grid and couldn't.

I think it's fine to close this issue now with the environment fix and we can open a new one if the problem re-occurs.