• News

• Industries

• Learning & Support

• Community

• Marketplace

# How would I math together instances of a static mesh in BP on the outside of a large sphere?

Hi everyone.

A call for all math geniuses

I want to create instances of a static mesh, each with its own rotation properties on the outside of a large sphere.

Its supposed to be a parameter in space. Like an asteroid belt but not a belt its all over the surface of a sphere.

I was thinking of cheating and just create a large sphere and use the foliage brushes and just paint instances onto the outside of the sphere.

But I was wondering if there is a way to math it out with vectors in stead.

I found a tutorial on how to set distances in world space of instanced objects in BP but not in a radius or outside of a sphere.

Anyone have an idea? TY !!

So I can get this far.
But donâ€™t know how to set the forloop index into a radius ???
Want those objects to sit around the outside of that sphere collision
I cant find a radius vector node.

I donâ€™t think there is a way to do this. Ha. Looks like it.

Unless there is a way to generate a radius with vectors somehow.

Found this in another forum

[COLOR=#6A737C]2

[/COLOR]

[SIZE=15px]In code, this is really simple to do. The following pseudo-code assumes that the objectsâ€™ origins are in the center, but if they are not, then all you have to do is to translate the final positions to account for the objectsâ€™ actual origins.

float offset = 0.0f; // Allows you to offset the initial object. const float step = 360.0f / objectCount; for (float angle = offset; angle < 360.0f + offset; angle += step) { const float radians = angle * PI / 180.0f; const float x = circleCenter.X + cos(radians) * circleRadius; const float y = circleCenter.Y + sin(radians) * circleRadius; object->SetPosition(Vector2(x, y)) } [/SIZE]
[/SIZE]
[SIZE=13px] [SIZE=12px]answered [SIZE=12px]Sep 3 '17 at 10:41[/SIZE]
[SIZE=13px]

[/SIZE]
Tyyppi_77 [SIZE=13px][SIZE=12px]5,150[COLOR=#6A737C][SIZE=12px]3[/SIZE][SIZE=12px]18[/SIZE][SIZE=12px]35[/SIZE][/SIZE]
[/SIZE]
[/SIZE][/COLOR]
[/SIZE]
[/SIZE]

[/SIZE]

Something like this?

confused by what you are doing honestly, but regardless thereâ€™s many wayâ€™s to skin a cat.

create a blueprint for Spore Spirit.

Add a Scene Component at 0,0,0
Add in the mesh of the Spore Spirit. Set the location X of spore spirit to the distance you wish it to be away from the center.

in the construction script for your level (i assume End_Zone_BP is the level)
For Loop from 0 to 360 - and pick an axis.
body > add blueprint instance, set instance rotation to index

Should be done.