- Home /
what is wallJumpContactNormal.y ?
I know that the normal indicates where an object surface is facing,
if(Mathf.Abs(wallJumpContactNormal.y) < 0.2f)
wallJumpContactNormal.y = 0;
///=====================================================================
Help me if Im getting this above part wrong... I read it as...
Ignore the height of the normal which is 20% above or below
//======================================================================
if(Mathf.Abs(wallJumpContactNormal.y) < 0.2f)
{
wallJumpContactNormal.y = 0;
moveDirection = wallJumpContactNormal.normalized;
//Wall jump gives at least trotspeed
moveSpeed = Mathf.Clamp(moveSpeed * 1.5f, trotSpeed, runSpeed);
}
else
{
moveSpeed = 0;
}
Answer by robertbu · Aug 10, 2014 at 01:53 PM
I would read this as: if the surface hit is modestly tilted up, or an any way tilted down, treat the surface as if it was straight up and down (not tilted).
Answer by Elson · Aug 12, 2014 at 07:58 PM
I got your point:
That way, straight up would be 0 and up to 20% tiltness(inclination) unity'd consider as straight up anyways and the player'd receive a force to jump out of the wall 105%, not less then trotSpedd and no more than runSpeed. Otherwise if the inclination is greater or less then this value(20%) it wouldn't receive no speed at all.
Is that what you mean?
At first I thought that the heith of the wall was the thing that'd trigger the player speed and direction setting. It'd only be active beyond 20% but that in fact would be inefficient if we'd jump from one wall to another cuz its height'd go over this amount.
I have just one more question...
''wallJumpContactNormal.y'' is comparing y(height) value to another value...(if it goes over/below 20%) if straight Up is zero... is positive 1 at -x?
Your answer
![](https://koobas.hobune.stream/wayback/20220613160254im_/https://answers.unity.com/themes/thub/images/avi.jpg)