+1 vote
func face(iprogress,predir):
    var target =vars.facing[predir].normalized()
    var start = vars.facing[currentfacing].normalized()

    var vec = start.slerp(target,iprogress)    ##!##
    global_transform = global_transform.looking_at(vec,Vector3.UP) 

At commented line I get :
E 0:00:01.915 setaxisangle: The axis Vector3 must be normalized.

func works through process(), and this error seems to accumulate exponentially.
I tried putting normalize() at every vector introduced around that function, nothing changes. Also, this error doesn't crash project, first interpolations seem to actually work ??

Godot version 3.5
in Engine by (8,099 points)

The error indicates a problem with a set_axis_angle() call (which IS documented to require a normalized vector). The code line you point to is not where the offending call is being made.

This is where editor highlights it. I understood that set_axis_angle() is called under the hood via slerp() method, since I don't call it anywhere in my code.
Actually error is gone after I ensured slerp doesnt get two identical vectors as arguments...

Interesting... As you mentioned, this can be recreated by setting the two vectors in question to the same values.

I just discovered, that slerping vectors3 is broken in 3.5. Editor can't interpolate not only identical vectors, but also any vectors with the same direction ( meaning inverse vectors ).
I had to decompose vectors to vector2, slerp it, and construct vector3 from the result. It Only now it works completely fine....

If you think you've discovered a bug, I'd suggest you report it on GitHub to ensure that it gets fixed in the future. See here for some instructions.

1 Answer

+1 vote

if the two vectors are equal then the error is raised.
Check the two vectors before using slerp.

var vec = start
if start!=target:
    vec = start.slerp(target,iprogress) 
by (50 points)

Yeah thanks, I discovered it as in answers above. This must ba a bug, no ? Since slerping vectors2d doesn't require them to be equal

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.