- Home /
Sprite Manager Remove Sprites?
Hey all,
I'm currently using sprite manager I for a 2d game and I'm having problems removing sprites.
I have it setup under a LinkedSpriteManager so it updates the sprites automatically.
The problem I'm having is removing the sprite once i'm done with it.
For instance heres what I'm trying when removing the main player sprite
Declare the variables at the start of the class
private GameObject player;
private Sprite playerSprite;
Now in the method that removes the sprite
spriteManager.RemoveSprite(playerSprite);
Destroy(player);
When I try this it doesn't work and throws an error which halts all the other sprites from updating.
The error i get is
NullReferenceException: Object reference not set to an instance of an object
Anyone else had this problem?
Answer by Luluandfriends · Aug 03, 2011 at 03:14 AM
Yeah, I have the same exact problem, but no one has answered this question =(
Your answer
Follow this Question
Related Questions
Spritemanager 2 and Box Colliders 1 Answer
Which framework for 2D Game? 2 Answers
Creating an array of texture variables 1 Answer
Animataion of a Sprite 0 Answers