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.
[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]
[SIZE=13px] [SIZE=12px]answered [SIZE=12px]Sep 3 '17 at 10:41[/SIZE]
[SIZE=13px]
[/SIZE]
[SIZE=13px][SIZE=13px]Translating the code above to blueprints should be fairly trivial. I have no experience with blueprints but surely you can create float variables, initialize them with values, loop with a for- or a while-loop and finally set an object’s position. – Tyyppi_77 [SIZE=13px]Sep 3 '17 at 10:47](unreal 4 - Radial/circle placement of meshes - Game Development Stack Exchange)[/SIZE][/SIZE]
[/SIZE]
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
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.