Programming a user controlled Robot arm

Hi!

I’m currently working on a simulator of a robot arm and got stuck. Basically I have the model assembed as an actor and just need to figure out how to make it rotate using user inputs.

I tried using the blueprint above to make it move but to no avail. Help will be greatly appreciated :slight_smile:

Hey there @Pr0Rad4R! Welcome to the community! In your use case, I would use Add Relative Rotation instead of set, but it still has one other issue depending on where where your pivot points are for your meshes. If each is in the center, your rotations will rotate from there. When not using bones, I would usually recommend setting your pivot points in the modeling program you had modeled this in.

Hi @SupportiveEntity What you said helps a bit but doesn’t fully solve my problem. What i need is to be able to make the object rotate only while I’m pressing a button (let’s say I want to use left arrow to make the first joint left and right arrow for the opposite direction)

If you know as well could you give me a suggestion on how to switch the controlled joint with player inputs as well? Would be much appreciated.

Thanks!

Hello. Rename “IA_RotateLeft” to “IA_Rotate“ and change it from “Axis2D” to “Axis1D”, that way 1 float axis is used to go from -1 to 1 in one InputAction. Then in your InputMappingContext, create 2 ActionMappingsfor each arrow, but add NegateModifier to one of them (whichever you prefer).

Right click on AddRelativeRotation’s DeltaRotation that @SupportiveEntity pointed out, and choose “Split Struct Pin“. Then connect “IA_Rotate“ ActionValueto the axis you want (Y in your case).

Hello. Thank you very much for help @AK_Ahmmad I did what you advised me to do but it still didnt solve the problem. The arm is standing still, even when i press the button. Any ideas what might be the cause?

I noticed you’re using static meshes. Try rigging it and using the action value as a driver for the animation blueprint.

Hello, you are welcome. Also don’t forget to multiply it by a value like you did before. It might be rotating but very slowly (don’t forget that the value is actually going from -1 to 1, so it is going by 1).