- Home /
How to create 2 vectors parallel to a plane? or Parallel to Hit.point? For hand IK placement
I'm want to make a script that scans an obstacle and then creates two vectors for the IK Hand position, so when the player gets close to the object they can climb over it or vault over it. I made a SphereCast that returns a normal and a point.
First I made this: hit.point + -transform.right _leftHandOffset hit.point + transform.right _rightHandOffset
But then realized that the two vectors will not be parallel to the object. Instead, I tried to take the hit.point subtract it from the normal and multiply it with the dot product of these two vectors. Just wished for the best... But I'm bad at Math.
hit.point - normal * Vector3.dot(hit.point, normal);
Is there a way to create a vector that is parallel to the plane of this object or maybe another solution?
Any help will be much appreciated.
Your answer
Follow this Question
Related Questions
How to get a vector3 (postion) 1 unit away from another in the direction of a 3rd vector3? 2 Answers
Getting vectors on an object every so many units 0 Answers
Can someone explain how this piece of code from third person prefab works ? 0 Answers
Move the bullet from the BulletEmitter in the direction player is facing 3D. 1 Answer
Please help, bullet drop is wrong at certain angles ? 0 Answers