Crashdash Geschrieben 28. Januar 2018 Melden Share Geschrieben 28. Januar 2018 Und ich bin's wieder. Habe jetzt versucht, meinen Character davon abzuhalten, steile wände hochzulaufen. Mal wieder kläglich. // X and Z first. We don't want the sloped ground to prevent // Player from falling enough to touch the ground. Vector3 displacement; displacement.x = velocity.x * Time.deltaTime; displacement.y = 0; displacement.z = -PlayerController.transform.position.z; characterController.Move(displacement); // Now Y displacement.y = velocity.y * Time.deltaTime; // Our steepest down slope is 45 degrees. Force Player to fall at least // that much so he stays in contact with the ground. if (-Mathf.Abs(displacement.x) < displacement.y && displacement.y < 0) { displacement.y = -Mathf.Abs(displacement.x) - 0.001f; } displacement.z = 0; displacement.x = 0; characterController.Move(displacement); Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Zer0Cool Geschrieben 28. Januar 2018 Melden Share Geschrieben 28. Januar 2018 Verwendest du den CC von Unity? Der hat ein Slope Limit Setting. Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.