Is there a way to get a kinematicbody to always face the camera like the billboarding feature on Sprite3D?
I'm trying to make a 3d fps game with 2d graphics but I can't figure out how to make the colisions face the camera while the sprite looks at it.
KinematicBody Billboarding?
- Edited
In this case you rotate the KinematicBody towards the camera itself, the billboarding is just an effect I think so it doesn't effect the transform rotation of the sprite.
https://godotforums.org/d/32065-rotating-node-on-specific-axis-in-movement-direction
Here's a thread I made awhile ago asking about this, had the same problem myself, but I was just looking for rotating my nodes generally without relying on look_at() as it would bork certain axis like Y which I didn't want changed.
Actually hang on, there's an even simpler solution, what you could do is use look_at() and disable the angular Y in the inspector if all you want to do is rotate the KinematicBody a certain way.
- Edited
My bad, it's because you're using a KinematicBody and I used the wrong name, there's an option in Rigidbody called Angular lock. I think though if you switch to rigidbody this method will work well if all you want to do is rotate and move around the characters Doom 1 style.
1:55 for relevant information.
Oh as for getting the camera in another scene I'm actually not sure on that one, I'm not 100% sure why you would do that in the first place, shouldn't you have two cameras in each scene? Would have thought the only one necessary for that is a player unless you're doing something special I don't know about.
Lethn
Thanks, I'll change to rigidbody. I need the camera in order for the rigidbody to know where to face, but the enemy would be a scene that gets instance after the game starts, and the camera would be in the player scene. Do you know if I could do something like "get_scene().find_node("Player")"?
- Edited
Don't use find to get the string of a node, use groups instead or some other method, this is what I do when I want to grab a node globally.
Peudo Code Example:
var playerCameraGroup = get_tree().get_nodes_in_group("PlayerCamera")
var playerCamera = PlayerCameraGroup[0]