miwarnec / uSurvival

1 stars 0 forks source link

Camera issues - clipping through ceilings #1

Open bradmdesign opened 4 years ago

bradmdesign commented 4 years ago

Versions (please complete the following information)

Describe the bug When you jump too close to a ceiling it will clip through.Tested on multiple versions with other users as well. Here is some in-game footage with game/scene view.

https://gyazo.com/89ef9958cf49d4e007fa7404dd7b41f2 https://gyazo.com/a95caa5d213a821f1899219f0b552ada

Non-jump, close to ceiling: https://gyazo.com/4c10074c9ce99d6aff4125ce54262afb

To Reproduce Close off a room and jump to the ceiling. Try with regular plane, then try with thin box collider, followed by a larger one.

Expected behavior The view should zoom to the character without being blocke dand without going through the ceiling. A natural lerp would be best.

Screenshots/Video https://gyazo.com/89ef9958cf49d4e007fa7404dd7b41f2 https://gyazo.com/a95caa5d213a821f1899219f0b552ada

Non-jump, close to ceiling: https://gyazo.com/4c10074c9ce99d6aff4125ce54262afb

System (please complete the following information):

This was originally in uRpg but it was tested in uSurvival too - there is no issue tracker for uRPG via the discord post.

miwarnec commented 4 years ago

thanks for reporting. I just finished two charactercontroller fixes. will look into this one asap.

relajosoft commented 4 years ago

For everyone, the solution to the problem of the camera crossing the roof:

PlayerLook.cs After the line: Vector3 target = transform.TransformPoint(origin + offsetBase + offsetMult * distance);

Add: if(movement.state == MoveState.AIRBORNE) { target = Vector3.Lerp(target,new Vector3(target.x, target.y-0.9f,target.z) ,0.4f ); }

bradmdesign commented 4 years ago

For everyone, the solution to the problem of the camera crossing the roof:

PlayerLook.cs After the line: Vector3 target = transform.TransformPoint(origin + offsetBase + offsetMult * distance);

Add: if(movement.state == MoveState.AIRBORNE) { target = Vector3.Lerp(target,new Vector3(target.x, target.y-0.9f,target.z) ,0.4f ); }

Unfortunately this one seems to create more zooming issues than previously!

relajosoft commented 4 years ago

My genius works for me, leave the distance of the camera fixed, so that it does not move with the wheel of the mouse and that's it! It works great!