How to rotate a normalised vector 3 by another normalised vector 3

Godot Version

How to rotate a normalised vector 3 by another normalised vector 3

Question

so im trying to rotate a direction by anther direction but idk how to do it

Can you please clarify what you expect the result to be? Perhaps with a picture..

Assuming, you have onready vars for both items whose directions you’re using;

@onready var obj1 : # (whatever node you're using to rotate)
@onready var obj2 : # (whatever node you're using to to base the rotation on)


func _process(delta : float) -> void:
	obj1.rotation = # (here is where you put the rotation math)

Now depending on what exactly you’re trying to do, the math changes, if you want the rotation to be so that obj1 is always facing the camera (obj2 would be a Camera3D Node in this case), you can do obj1.rotation = obj2.rotation

If you want the rotation to be the difference between the two, you could do obj1.rotation = (obj1.rotation - obj2.rotation)

But without a more detailed explanation of what you want, idk how useful this advice is lol