- Home /
Sprites always facing camera problem - sprite manager 2 possibility.
Hi,
I'm making a first person shooter game.
I want to save on juice and use sprites to simulate tiny plasma balls meaninglessly flying around. I've done it before in Blitz 3D engine but I know very little about scripting. I have the tiff and can paste it on a plane. I can move around it and it looks great. However, I cannot make it face the camera. I've looked at Sprite Manager 2 but the video doesn't indicate whether you can make the 'animated cow' sample always face the camera. Need to know for certain before I buy it.
Thanks
Answer by Tetrad · Jun 16, 2010 at 07:19 PM
I don't know about SM2 (as I don't have a copy of it), but the math for doing a billboarded sprite is pretty simple. The original sprite manager (found here) has been updated to support it. If SM2 doesn't have it out of the box I'm sure it wouldn't be too hard to add it.
Add the smoothLookat script to the sprite and make the maincamera the object to look at.
Don't use smoothLookat, it'll distort your sprites at the corner of the screen. Use the link from the answer above. Thanks for that btw :)
Answer by Thom Denick · Jul 25, 2010 at 04:45 PM
This can be done in SM2 by simply attaching the sprite to the camera. It's built in.
Answer by Leviathan · Jan 27, 2011 at 02:22 PM
I have the same problem, trying to make a plane face the camera. The Script from the Unify Community, referenced above, lets my plane's edge face the camera. Of course, this is not the effect I hoped for, since it is more or less invisible that way.
Edit: Problem solved.
I simply created the plane in Maya and rotated the vertices, so that the plane actually had a different coordinate system than the one you create as a standard in Unity with GameObject --> Create Other --> Plane.
Was I the only one with that problem? Is there an even easier (and maybe more elegant) way to do this in Unity?