trophy 0
May 2025 36 posts
Rotation.LookAt : api/Rotation/LookAt
trophy 25
Jul 2024 10 posts
Simple component which makes the object always face towards the scene's camera:
public sealed class FaceTowardsCamera : Component
{
	protected override void OnUpdate()
	{
		WorldRotation = Rotation.LookAt( WorldPosition - Scene.Camera.WorldPosition );
	}
}
trophy 555
May 2021 15 posts
oooor you can use the static method meant for this! https://sbox.game/api/Rotation/FromToRotation
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.