Download

Rotate actor from an offset or move povot point?

I’m trying to rotate the floor the player is standing on based on the player’s current location. So if he’s standing in a corner, it rotates from the corner. If he’s standing on an edge, it rotates from that edge, etc. I can’t seem to find a way to modify the rotation pivot or set an offset for it.

Hi @SeldinG

Using a scene component you can rotate the platform from wherever you want.
To make the Platform “follow” the walkable line in the middle
you have to move her to the inverse of the Scenecomponent.

Well, here an example

Thanks Est_engine, but I actually considered this. I was hoping this method wasn’t the only way. The issue is the platform would then be physically moving around the world and cause it to misaligned with other objects in the world. That means I’d have to also align the world to the match the offset. So the sky, other platforms, any decorations, and collectable items would also have to somehow tie into that scene component’s position relative to themselves.

In terms of level design, the only thing I can think of is after setting everything up, then do a scan at the start of the level to find all the objects, and attach them as children to the scene component. But attach child component wasn’t working.

I also tried getting all actors of class, storing their locations, then spawning the actors attached to the scene component using the old object’s position and then destroying the old object. That didn’t work well either.

Try to be more clear , i really dont understand .
Didnt you asked how make the floor rotate using the character as pivot?
if it rotates , it surely will misalignedd with other objects in the world…

““That means I’d have to also align the world to the match the offset.””
??

I am completely lost,
do you want to rotate the whole world?

Nice answer @Est_engine. @SeldinG: The answer is a relative thing, it wont mess with any other things happening, world or not…

Sorry, I was attempting to keep things simple and ended up oversimplifying. Everything in the world has to move this way except for the sky. Like I said, my first attempt was to create a single “world object” which is just a scene component and everything else in the level gets attached to that object and are set to a positional offset to the player. This works but I felt maybe there was a better way given that I have to write this behavior for every actor. Since we came to the same conclusion I’m guessing it’s the only logical one.

The smoothest way I’ve found to handle the finding and attaching of each object is to set a tag and get all actors with tag, set that to an array. But in that case, I’d have to run that array through a loop on a tick which is hella slow. If I use BP actors then I can forgo the loop and have the offset code written within each one. I’m not sure which is faster, honestly. In terms of level design, I’d say the former, but performance-wise, I lean on the ladder.

Let the world be static and instead rotate the camera and the player , (and the sky if is really necessary)

I have done some tests for my game with multiple actors or meshes, and i got really laggy with just 10 groups of 10 actors or meshes.
Make the whole world is pointless, rotating everything but one thing is like rotate that only thing