Navigation issue

Godot Version

4.5

Question

The navigation works, that's not the problem, the problem is when I initiate the look_at() function the character totally glitches out... Can I get some help? I have a vid about it...:

You might want to rotate only the visual representation, not the whole body.
Also, use global_position for look_at()

I tried, but it didn’t work…

Tell me if I need to send more info about this bug.

Yes, you need to send more info. As much info as you can. “Didn’t work” is not very useful. Software developers should never say just “didn’t work”. Always describe what exactly you tried and in what way it “didn’t work”. If you only rotate the visual representation - the results will likely be different from rotating the whole body, even if it “didn’t work”. That difference is important as it can point to the source of the problem.

1 Like

you just dumped the whole project,explain it to us that what you see now

1 Like

And where’s the code that only rotates the visual representation?

It’s the first one, at the second one I gave you the navigation agent of the enemy, at the third- fourth it’s the navigation mesh, and at the fifth, it’s the enemy(in case of any problems with arranging my nodes)

you can just rotate the Block_Bench Node if it’s just a simple 3d model walking around but if it has raycasts etc then you have to rotate the whole character (well you can use raycast/area3d from the Block_Bench Node if you want to)

Okay, I’ll give it a try…

IT WORKED! THANK YOU SO MUCH! But I still need one thing… I want it to only rotate the y axis… Is there any way?

lemme try to rotate the character( I am trying it )

nevermind, i figured it out…

You said you tried it and it didn’t work. Now it’s suddenly working? If you didn’t understand what I meant by “visual representation” you should have asked.

If you want look_at() to rotate only around y, set target position y to be the same as node that’s rotating y

1 Like

@Randomgamecreator123

it works with the method @normalized suggested in the first post

look_at(Target.global_position,Vector3.UP)

it doesn’t glitches or anything,there’s might be a problem with the collusion or something

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.