• News

• Industries

• Learning & Support

• Community

• Marketplace

# Using the radius of a sphere as a spawn zone? [Solved!]

So I’m working on a pretty simple spawn blueprint for the enemies in my game. I want it to be fairly dynamic so I can dot them all over the map and adjust each one to spawn enemies. One of the things I’d like to be able to do is set a visual circumference of the spawn zone so when I’m placing it, I can verify where enemies may spawn within it.

So to do this I created a collision sphere with no collisions and set it to be visible in the editor. I used some basic math to get the radius and then use that to set random locations within that radius to spawn my enemies in. So if I scale it up or down in the scene it will dynamically change the area they’ll spawn in.

But I’ve run into a snag. The radius of the sphere doesn’t seem to correspond at all to the units in the scene. Maybe I just don’t understand the engine well enough and should have known that, but what I tried doing was finding a formula to adjust the math to fit the size of the sphere, but no matter what I try it’s completely off once I scale the sphere and test the spawn limits again.

Any ideas on how I can accomplish something similar or how to go about making this idea work better?

Well I solved it myself. I realized that scaling the sphere probably wasn’t changing it’s original diameter so maybe there was a way to get it’s in-game scale. Turns out there’s a node called “Get Scaled Sphere Radius” which works exactly how I thought it would work, no multiplication or formulae required.

Thanks anyway if you read this!