Actors spawning in wrong location

I’m having a very strange problem with a blueprint I created.

The blueprint is basically a crate from Crash Bandicoot with some minor differences. The collectable items that come out of it are not directly added to your inventory, but rather launch out, similar to a treasure chest in Spyro.

A few weeks ago, the crates stopped spawning the collectables when the player destroyed them. It took me a while to figure out why, but eventually I figured out that for some reason the blueprint was now spawning them somewhere else in the level. I don’t recall exactly what code was different at that time, but I think I took off a node that was setting their relative or local position, which fixed it.

This seemingly occurred for no reason, I did not edit the blueprint and looking through my perforce logs showed that no one else had either.

The problem is now happening again. The collectables are set to spawn 15 units above the center of the crate on the Z axis. When this was enabled, they would spawn several thousand units away on the X and Y axis. Setting all spawn transform values to 0 would cause the collectables to spawn slightly below the playing field, but in the correct X and Y position. Setting Z to 1 would fix the issue.

Is this a bug in unreal? Or am I just going insane?

1 Like

Or you could post a screenshot of the relevant snippet of script. Perhaps someone can poke a hole in it. Consider it.

The collectables are set to spawn 15 units above the center of the crate on the Z axis. When this was enabled, they would spawn several thousand units away on the X and Y axis. Setting all spawn transform values to 0 would cause the collectables to spawn slightly below the playing field, but in the correct X and Y position. Setting Z to 1 would fix the issue.

This already sounds strange as is. I don’t understand why you’d want to set any transforms. If I had a spawner, I’d:

Now, that 15 is not enough Z to spawn anything above - things would overlap badly unless collision channels were set to ignore. And handling collision overrides is another thing not explained in the example.

I was recently creating a destructible object with chaos destruction which when an object is placed in the scene it applies a location set by the editor. I was then creating a blueprint to add that geometry collection to spawn in another blueprint switching the meshes to simulate destruction. Of course there are some steps to hide the other mesh and collision prior to spawning the geometry collection but the destructible wasn’t spawning in the proper location so i chose to use the location of the scene root as likely it was a bit more accurate yet my destructible would only spawn at the location I originally set it in the scene. I believe this is a possible bug with the editor. I only get a result close to what im looking for by using the location of the mesh in the main blueprint of the object im replacing. You can also try breaking the pin to get more precise locations or even set them manually.