UE5 Spawn Actor Rotation Problems

Hey guys,

I am making a Slender clone in UE5 and I want the pages to spawn in pseudo-random places. There are 40 locations they can spawn in. I used an array of transforms to do this. I found the transforms by placing all 40 pages in first and copy/pasting the values into the array, so I know they are the correct values. When I hit play, however, some of the pages are rotated incorrectly, messing the whole thing up. I compared those pages’ rotation values to the placeholder ones, and they are identical, despite being rotated differently. Does anyone know how to fix this? It would be a huge help.

-Tyler

Do the page meshes have any collision?

Are the pages unique pawns - do they have their own model for each page?

I am using the same blueprint for the pages, so they are all the same mesh. The page is set to only collide with the player and I set it to “ignore all collisions” in the Spawn Actor node.

I am using the same blueprint for all 8

The page is set to only collide with the player and I set it to “ignore all collisions” in the Spawn Actor node.

It’s really hard to say from here. I think it’s something you could debug by breaking it down.

  1. Does you process work in an empty level?

  2. Does it work in the current level, but with a lot of stuff removed?

  3. Work on one page you don’t like the look of.

Lots of print nodes etc…

1 Like

They’re being spawned in the level blueprint. I started with a test and it worked. What’s got me stumped is that all 8 are spawned by a loop, and the code is small and simple, so I’ve been able to scan through it pretty thoroughly bht there doesn’t seem to be anything wrong with it

Can you show that code?

Another thing, none of your stored rotations are greater than ±180?

Some are. Does that break it?

I checked and none of the messed up pages are over 180 degrees.

Here is the main code in the level blueprint. What it does is select a landmark to spawn the page at:

And here is a function from the end of the switch statement. This one selects one of the spawn points within that landmark:

The engine could easily correct 185 to 5, for instance.

The only thing I can see here is that this

image

could cause problems if you don’t have exactly 4 spawnpoints in each array. It would be better to use 0 - ‘lastindex’.