How does this happen? Changing target components doesn't have any effect in script?

New UE5 user, thanks for any help!
I have a balance scale that I’m using for my game project and I’m trying to get it to move when one side is heavier than the other. I’m using a timeline to help manipulate the arms and plates on each side. Initial testing showed that the scale plates are moving opposite to what they’re supposed to. No problem, right? I’ll just switch the plates in the output of the timeline. But that had 0 effect in the result. Am I missing something or is there a better way to accomplish this or do I just completely misunderstand how actor components work?



1 Like

I’m not quite sure what’s going on here, but if you just attach the plates to the scale arms in the component hierarchy, all you have to do, is rotate the arms. :slight_smile:

@ClockworkOcean I appreciate the suggestion and I explored it a little bit. If i attach the plates to the arms they also rotate with them which means I need to reset their rotation after the scale arms move. When I do that they don’t align with the ends of the scale so I have to set their transform again too using a timeline and run into the same issue where it doesn’t matter which plate I set for each of the timeline outputs each plate does what the other plate is supposed to do. I’ve switched the plates for each of the set transform target nodes like 30 times and I’m at my wits end. :exploding_head:

1 Like

Yes, you’re right, I didn’t visualize it hard enough :slight_smile:

But switching the plate variables should work. Did you recompile after that?

( I think you’ll have similar problems even if that does work )

To make it really look like scales, you either needs to enable physics somewhere ( not my area ), or angle the plates while you’re tilting the arms.

I will figure something out soon, if I get a moment… ( I’m thinking the hanging plates must always align with the vertical, not too bad ).

@ClockworkOcean I’ve been switching variables like a madman. Switching the output tracks of the timeline, the hierarchy of the plate components, and using print strings and changing the plate’s material for debugging I get different unintuitive results every time.
I found a solution, but it’s frustrating that it doesn’t solve the problem that the blueprint isn’t working as intended so as a new developer I’m not learning why it didn’t work in the first place… In the level editor I just turned the whole scale 180 degrees and made negative the rotation output for the arms in the timeline. Now even though it’s not working as intended when I drew it up, it’s at least working lmao :sweat_smile:

You said this originally. It sounds like maybe you have the curve in the TL setup wrong. If it’s going up, when it should go down, then no matter which side you connect it to, it will go the wrong way.

In any event, the much easier way to do TLs, is only to have a 0-1 curve in there, and then accomplish all the changes you want outside, using lerp nodes.

1 Like

That sounds like a much easier way to do this. Let me get to lerping and see if that helps it work as intended.

1 Like

Tell me if you need any info :slight_smile:

0-1 track in the timeline with lerp nodes fixed it. I double and triple checked my timelines before but I must have missed something. Lerping was also significantly easier to draw up so I’ll definitely be doing that from now on. Thanks so much!

1 Like

:sunglasses:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.