- Home /
Particle Renderer and Line Renerer like facing the camera
Hi,
I want to know if there is a mesh or material property that can help me achieve this without script attachment.
In my code, I create a plane that only consist of 2 triangles (just like the particles in particle generator) and then automatically to have the object face the camera regardless of camera's position. If you look at Line Renderer, the same thing happens. It always looks at the camera.
Have those two Renderers been written in a way that always updates their rotation?
Any help would be appreciated, but please do not mention transform.lookat or Quaternion.LookRotation unless you are absolutely sure that it is the way the latter renderers work.
Note: I'm talking about the billboard in ParticleRenderMode. Thanks,
Answer by TheDarkVoid · May 13, 2013 at 11:04 PM
To achieve that effect just do this:
void Update()
{
transform.rotation = Camera.main.transform.rotation;
transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y -180, transform.eulerAngles.z,);
}
This gives the error: Error 3 Cannot modify the return value of 'UnityEngine.Transform.eulerAngles' because it is not a variable.
Unfortunately it doesn't face the camera. It simply rotates when the camera rotates. That is not what I need. If the camera is stationary no matter the rotation of the camera, it should face the camera.
maybe i did something wrong with the second line, this is what i used to get this effect only without the second line, i just compensated for that in the scene before hand.
Your answer
Follow this Question
Related Questions
survival shooter particle system, cant change start/end width paramaters? 0 Answers
Is it possible to use a line renderer as a mesh for a particle emitter? 0 Answers
Why does my particles look different from a distance on iOS? 1 Answer
Particle Emitter, Animator and Renderer 1 Answer
"Energy" trail in character movement 1 Answer