Question by
CatFisting · Oct 29, 2018 at 03:54 AM ·
c#movementspritessimple
Sprite is disappearing in 2D game.
Here's a video in which you can see the issue occuring. The "goblin", or the red guy, has a sprite which disappears upon loading goblin.cs
http://https://i.gyazo.com/7b9b719fe1afb7db6a4466df137a68f5.mp4
The script is incredibly simple.
public class Goblin : MonoBehaviour {
[SerializeField] private GameObject player;
private float speed = 5;
void Update () {
transform.position += transform.forward * speed * Time.deltaTime;
transform.position = new Vector3 (transform.position.x, transform.position.y, 0);
transform.LookAt (player.transform);
}
}
The goblin sits at Z = 0, as does everything else. The camera is at -10.
The goblin is on the highest possible layer.
Near camera clipping is set to .05.
The goblin is clearly still there; his sprite is just invisible. What could possibly be causing this?
Comment
Your answer
Follow this Question
Related Questions
C# movement code with the maximum movement speed. 1 Answer
Why Can't I get 2D object to Move? 1 Answer
Character movement 0 Answers
Implementing a "flyer" game in with the old CardBoard Google sdk 2 Answers
Make Ball roll without imput 0 Answers