I am completely new to unreal engine, however for the first part of a bigger project that i have to do is to make an object rotate on button click (so rotate left on a and right on d).
I tried to make the first button click in blueprints, however it is spinning no matter if the button is clicked or if it isn’t. i figured i would add a basic print node to see if it was registering key presses, however nothing shows up in the log here either.
Hey there @mmartin139! Welcome to the community! So what’s happening is that the rotating movement component has it’s own constant rotation rate. Your script takes the object and immediately sets it’s relative rotation to -180, and sets it back to 0 on release.
This is not interacting with your rotation component at all. Now take a look into the details panel of the rotation component, in it’s Z rotation rate it has a 180 value, which means it’s going to rotate in the Z every single tick on it’s own. So first set that to 0, then you will want to adjust your script to reference the movement component then set it’s rotation rate to 180 instead of setting the relative rotation.
Edit: Example
Launching unreal now to give you an example!
so because i am currently using an actor component and not a character component, it doesn’t want to connect as the target. to be specific on what i want this to be, this will turn into an robotic arm that can rotate on its base and eventually rotate on its pivot points for joints. so a non-moving camera aimed at this actor, and the actor being able to move on key press.
i don’t have anything set up as a character because i don’t really need a character for this case. any clues on what i should do to achieve this? should i make the arm a character fo a pawn instead, or is it ok to be an actor?
Alright so I think you may have used the context menu and brought in a variable for a character movement component. You can actually drag out from the rotating movement component reference directly regardless of actor type and access it’s rotation rate directly!
Let me know if you have any questions!