- Home /
Billboarded sprite with rigidbody in 3D world - slides around on top of surfaces
I've got a 3/4 view perspective camera which can rotate around in 45 degree increments, and my characters/items are billboarded sprites with 8 possible facing directions. Something like Final Fantasy Tactics, Persona 2 etc. Problem is, the billboarding is causing part of the object to be inside the surface it sits on, and it slides around until it hits a wall. How should I approach this? Is there a way I can say, billboard the sprite but have a collision mask that's untouched?
Couple things of note... One, the problem behaved differently on two different video cards in Unity 4, and B, the sliding is a lot faster since upgrading to Unity 5.
Answer by LividPixel · Aug 14, 2015 at 01:24 PM
If you're going to do something like a billboard as a graphical effect for your object, you're going to want to segregate the object's physical representation and graphical representation. You could have another object (that doesn't have a Renderer) represent the object physically, and have the graphical representation (with the billboard script) be a child of that object.
If the object is behaving differently depending on the video card, or changing in Unity 5, it could be dependent on the framerate. This often occurs if you're moving something around in Update() without using 'Time.deltaTime'. This is usually the first thing you should assume if things go haywire when you uncap the framerate/turn off v-sync.
I can imagine, with the billboard script affecting the collision resolution, the script would change the rotation of the object and put it within the ground, then collision would resolve and it would be moved. At a higher framerate, if the billboard script isn't placed in FixedUpdate(), this could occur more frequently.
Your answer
Follow this Question
Related Questions
Unity 5.1.1 Transform Lag/Bug 0 Answers
Unity 4.3 Any chance Sprite mesh will become accessible in futur update ? 1 Answer
Rotating a Sprite to face mouse / target? 2 Answers
UI Image has no sprite definition 0 Answers
Running 2D Sprite Animation Once? 2 Answers