# Paper2d unable to see sprite after spawn in code

**URL:** <https://forums.unrealengine.com/t/paper2d-unable-to-see-sprite-after-spawn-in-code/441615>\
**Category:** Asset Creation\
**Tags:** expose-on-spawn, unreal-engine, UE4, CPP, question\
**Created:** [January 19, 2019, 2:56am UTC](https://forums.unrealengine.com/t/paper2d-unable-to-see-sprite-after-spawn-in-code/441615 "2019-01-19T02:56:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Capitals](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Capitals](https://forums.unrealengine.com/u/Capitals)\
**Post date:** [January 19, 2019, 2:56am UTC](https://forums.unrealengine.com/t/paper2d-unable-to-see-sprite-after-spawn-in-code/441615/1 "2019-01-19T02:56:11Z")

</div>

I am unable to see in the game spawned actors with paper 2d sprites when they are spawned, if I eject out of the game and edit properties the property suddenly shows. I’ve attempted to try and edit properties post spawning. All of the properties are initialised in a blueprint.

Before editing a property when actor is spawned.

 ![265844-problem2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/3/8a3b13aa12233cdc4cf89853cadafdd8af3ec512.jpeg)

After editing a property when actor is spawned.

 ![265845-problem1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/b/beb36a7c9c3b57228099ca164463b7960ee803a0.jpeg)

This is the code that spawns it - apologies for it being messy I’ve been trying this for several hours…

Defaults

```
	PrimaryActorTick.bCanEverTick = true;

	SceneComponent = CreateDefaultSubobject<USceneComponent>(TEXT("SceneComp"));
	SetRootComponent(SceneComponent);

	paperSprite = CreateDefaultSubobject<UPaperSpriteComponent>(TEXT("PaperSprite"));
	paperSprite->SetupAttachment(GetRootComponent());
	paperSprite->RegisterComponent();

```

Asteroid Spawner.

```
void AAsteroidSpawner::SpawnAsteroid()
{
	FVector spawnLoc = FVector(0,0,0);
	FRotator spawnRot = FRotator(0,0,0);
	FActorSpawnParameters params = FActorSpawnParameters();
	params.bDeferConstruction = false;
	params.Owner = this;

	AAsteroid* asteroid = GetWorld()->SpawnActor<AAsteroid>(AsteroidClass, spawnLoc, spawnRot, params);
	//asteroid->paperSprite->SetSprite(AsteroidClass->sprite);
	asteroid->UpdateComponentTransforms();
}
```

---

<div class="post-metadata">

**Author:** ![Capitals](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Capitals](https://forums.unrealengine.com/u/Capitals)\
**Post date:** [January 19, 2019, 11:20am UTC](https://forums.unrealengine.com/t/paper2d-unable-to-see-sprite-after-spawn-in-code/441615/2 "2019-01-19T11:20:25Z")

</div>

So I’ve managed to get this somewhat working, by setting the sprite, after spawning the object. However still if I spawn wanting to use my default values I come up with the same issues.

---

<div class="post-metadata">

**Author:** ![EnyeartBaed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EnyeartBaed](https://forums.unrealengine.com/u/EnyeartBaed)\
**Post date:** [February 18, 2019, 2:26pm UTC](https://forums.unrealengine.com/t/paper2d-unable-to-see-sprite-after-spawn-in-code/441615/3 "2019-02-18T14:26:09Z")

</div>

Yeah! The same problem was happened with me last time when I used this software. I really don’t have much knowledge to operate this software fully and feel helpless at the moment when this problem occurred. But after seeing that you’ve shared this [Facebook profile Edubirdie](https://www.instagram.com/edubirdie/?hl=en) article then I realize that good and helpful people are still there and we just need an eye to see them.
