x


Billboard script

In my project I am trying to create some trees in the far background. I wish to use an image on a plane to keep the poly count as low as possible. Could anyone please tell me what script is needed to billboard these planes and have them rotate to face the camera as the player moves?

Thank you

more ▼

asked May 01 '12 at 12:35 PM

clinington gravatar image

clinington
0 2 2 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

public void turnTo(Vector3 point) { Vector3 direction = point - transform.position;

    // Rotate towards the target
    transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation(direction), AI.rotationSpeed * Time.deltaTime);

    transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
}

This will help you. But do not run this cript wen player to far. Best way is to use 2 playnes with out anu rotation scripts

more ▼

answered May 01 '12 at 12:49 PM

lacost gravatar image

lacost
1 3 9 13

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3316
x248
x62

asked: May 01 '12 at 12:35 PM

Seen: 1003 times

Last Updated: May 01 '12 at 12:49 PM