Hey, i have simple vector math problem that i can’t solve.
When my character capsule (a sphere) hit a wall, he will bounce back with a “launch Character”.
It works perfectly when i jump on a wall, but if i simply walk to a wall it dosen’t, it will take the wall normal to launch and then the floor normal and it result in glitches
I need to figure how to add the wall normal from the wall to the normal of the floor and use this to calculate a diagonal launch.
It dosent work, i think my problem come from the fact that my sphere collision give me the wrong normal…
I’m walking on the floor AND hitting a wall so i need to get theses 2 values…
Maybe i should do 2 traces instead if getting the impact normal from the capsule hit ?
That’s what the script does. Perhaps the issue is that you want to rely on floor normal while you should be relying on the Normalised velocity when hit occurs. Hence my question about the floor. I don’t think you care about the floor, per se, you care about travelling perpendicularly to the wall surface.
I just did a print on Capsule Hit → Break → Impact normal
and when i run in a wall while NOT jumping, the “Impact Normal” seems to be random between Y1 or Z1 meaning the capsule sometimes register the hit as a floor and sometimes as a wall, making all my vector math useless…
i will try with one trace in the direction of my character and another pointing at the ground, but it will be way more costy on perfs…
Another thing altogether is why would one use a ball and a capsule. Why even use a character class to start with? Isn’t the character a ball? Oftentimes, there is an assumption at the root of the issue.
I might be off my mark, perhaps you must use a character class because the ball is actually a humanoid ball with limbs and all
I can only imagine the frustration when you want to roll around and you’re forced to use a capsule as the root collider.
Yeah im sorry if we misunderstood, i simplified my issue so it would be more understandable.
Im talking about my player here, its a character and not a simulated Ball.
I have a regular Capsule on my character, but when i run and press crouch, my capsule turns into a sphere with the “crouch” function and the character does a roll.
when i roll into a wall while in air, i was able to bounce my character properly.
But when the character rolls on the floor and hit the wall, the capsule HIT seems to give me a random normal, it could be the wall, or the floor.
If we’re not on the floor, we simply mirror. If on the floor, we bounce back at a 45 deg angle. You may need to Normalise the top False bit first, and then apply a multi before Launch.
So i used my old formula to calculate the launch, and it works just fine, the only difference is that i removed the capsule Hit and used a line trace instead.