I was curious if there was a way to lock a relative transform of an actor to that of another actor in a level by simply parenting it underneath the other in the World Outliner. I know you can do this inside of a BP but, I was just curious if it was possible to do it just in the level.
Yes, I think you can do it just like you described there. After parenting, changes to the parent will affect the child…
That works on the BP side of things yes but, it doesn’t seem to work on the level side of things. I.e. I have two actors in the level and I parent one underneath the other and the parent moves, the child does not. Maybe it is because the parent is physics based?
Are you doing the parenting over here?:
or here:
Both work for me, the cone rotates with the cube, like it’s stuck to it…
I’m trying to parent it like in your second example. Where the cube and cone are both separate actors in the world. Maybe it has something to do with physics?
I turned on simulate physics and they’re still stuck together. What are you trying to do?
It can have something to do with physics. If you try to attach something that simulates physics, the simulating component (capsule, mesh) should preferably be the root component of the actor. If that’s not the case, the actor itself doesn’t move (if attached, it would actually follow the parent), and the physics component simulates and moves independently.
Could that be the case here?
I believe this is the case actually. I have a crane set up with physics constraints and the root component is essentially the base of the crane which doesn’t move.
If you want to lock an actor to a special part of the crane (like the hook or something), the above method won’t work. Try one of the following:
-
If you want it to be there from the start, drag it into the crane BP as a child of the (moving) component you want it to be attached to.
-
If you want to be able to change it at runtime, you would need to implement some inputs first, also think about how you want to distinguish which actor you want to attach when you press a button (like an overlap event of the “hook” component and an actor in the world) and then use AttachToComponent for said actor and attach it to the hook.
The more clearly you specify what you’re trying to achieve, the easier it is for us to help you In general, most of the time you try to fake things and make them look real, instead of actually making them work in a realistic way.