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 :slight_smile:

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 :slight_smile:
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



[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=13px] [SIZE=13px]share[SIZE=1px]|improve this answer[/SIZE]
[SIZE=13px] [SIZE=12px]answered [SIZE=12px]Sep 3 '17 at 10:41[/SIZE]

Tyyppi_77 [SIZE=13px][SIZE=12px]5,150[COLOR=#6A737C][SIZE=12px]3[/SIZE][SIZE=12px]18[/SIZE][SIZE=12px]35[/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.

Adding actors tutorial:…nts/index.html

Also, make sure not to ever think it a good idea to add an OnTick item to these actors unless you REALLY, REALLY, REALLY need to… (and you don’t you can animate by assigning it an animation blueprint). It’s 360 ticks happening for no reason…

Oh, you should not change the location from the script, but you can if you need to offset them. I just see all of your pictures being evenly spaced out, so kinda figured you wanted it static.
If you wanted to offset them i would use a random number between -30 and 30 to offset the z axis rotation. gives it a nice range of 60 degree which may look like an asteroid belt.

Great thank you very much.
I will look at this tomorrow first thing !!

I don’t have one single TIC in the entire game project.
You can be proud of me :slight_smile: