- Home /
Question by
Damien113 · Aug 08, 2015 at 06:28 PM ·
unity 5camera-movement
Billboarding
Im having trouble with bill boarding something with a basic script ( Shown below ). Now im comparing this to the grass Billboarding built into unity terrain system. My Billboarding is slightly rotated so it looks weird, now how can i make my Billboarding like the grass system?
using UnityEngine;
using System.Collections;
public class CameraFacing : MonoBehaviour
{
public Camera cameraToLookAt;
void Update()
{
Vector3 v = cameraToLookAt.transform.position - transform.position;
v.x = v.z = 0.0f;
v.y = 90;
transform.LookAt(cameraToLookAt.transform.position - v);
}
}
Comment
Try just looking at "v" ins$$anonymous$$d of camera transform position - v
Your answer
Follow this Question
Related Questions
Smoothing camera edge scroll 1 Answer
ThirdPersonController camera Jitter when moving 1 Answer
Camera Problem 0 Answers
restrict camera movement, Camera moves out of bounds! 2 Answers
How can I rotate my camera when player has rigidbody? 0 Answers