- Home /
Question by
TwilightZone13 · May 10, 2021 at 03:52 PM ·
c#3dcapsulecast
I am having trouble with getting CapsuleCast to work.
I am trying to create a capsulecast that is directly under the player but I can't see it which makes it hard to know exactly where the 2 spheres are placed to cast the capsule. The player is just a capsule that has a scale of 0.5 x 0.5 x 0.5.
Vector3 sphere1Pos = new Vector3(transform.position.x, transform.position.y * (-capCol.height / 4), transform.position.z);
Vector3 sphere2Pos = new Vector3(transform.position.x, transform.position.y * (-capCol.height / 4 - 1), transform.position.z);
foundHit = Physics.CapsuleCast(sphere1Pos, sphere2Pos, 0.25f, -transform.up, out hitInfo);
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
What is Matrix4x4? 2 Answers
How do i code a Mesh collider ? 1 Answer
Using animation curves for fall and roll-over in and endless runner 3d 0 Answers