SetRelative vs SetActor

Hello!

I’m two weeks into UE4 and have really been absorbing as much as possible. Right now I’m working on learning adjusting rotation and location on objects in a devolpment/test map. The idea is to have panels where, on mouse click, one will slowly adjust location and the other slowly adjust rotation. I have both working using a timeline feeding into a vlerp, but one thing about this Blueprint is throwing me off…

On location adjustment, I’m forced to use a “Set Relative Location” whereas my rotation function only works with “Set Actor Relative Rotation”. The two actor blueprints are duplicates with minor tweaks made to set location vs. rotation. When I use “Set Actor Relative Location” instead of just “Set Relative Location”, the panel instantly appears to disappear on mouse click.

I’m hoping to understand this issue better - why must I use “Set Actor” on one blueprint for setting location while I can use “Set Relative” on another blueprint (duplicate) for setting rotation? Again, when I replace “Set Relative” with “Set Actor”, the panel seems to instantly disappear. I’m sure it’s not disappearing but only appears this way, and hoping to better understand the mechanics behind this function.



Thanks!

“Set Relative” in UE4 doesn’t actually add to location/rotation on Actors. It moves components around inside a blueprint actor.

For what you’re doing, it sounds like you want “Set Actor Rotation” and “Set Actor Location”. For your setup, you’d want to store the original rotation/location of the panels in a variable (perhaps using “Begin Play”), then offset those values when the panels are clicked.

Many thanks for the response, Ninetail, and what you said re: “Set Relative” definitely makes sense. As for what I’m doing, if I replace “Set Relative Location” with “Set Actor Location” then the panel disappears from the map on click. I’ll try your suggestion this week to see if I can use “Set Actor” without this issue occurring.

The actor may be disappearing from the map because it is being moved out of your view.

“Set Actor Location” instantly teleports the actor to the coordinates you specify. Calling set location with small changes in position over a period of time is what creates the illusion of movement.

Check the values in your timeline and make sure they are being added to the original location, and that the changes are small enough not to shoot your panel off into space somewhere.