MrQUIVY I don't know what the F you are trying to do.
translation interpolation is easy and can be done in one line of code.
maybe your problem is you are using C#, and C# is a garbage language that wastes your time with overly verbose code that does almost nothing.
Vector3 Norm = Recoreccting ?
is that a conditional with ternary operators?
Util.Vector3
WHY?
the docs say you define a Vector3 in C# with:
var c = new Vector3
vector3 has its own lerp
method.
unless Util
is an object (this is why C# sucks, in gdscript I would be able to tell an object from a static class method)
you are lerping 3 values when lerp only takes two, unless that is a custom function you made to interpolate between two vectors.
if it's the custom function, you are ALWAYS lerping halfway though because neither Vector3
is changed and 0.5
is always 0.5
.
code does what its told to do.
you have to either use lerp on a variable that will be changed:
global_position = global_position.lerp(Vector3.UP, 0.5)
or progress the interpolation amount from 0 to 1:
var progression = 0.0
func progress(delta : float) -> Vector3:
progression += delta
if progression > 1:
progression = 1
return global_position.lerp(Vector3.UP, progression)