Reply To: Rotate as long as key is pressed

Forums 💬 NodeCanvas 🗨️ General Discussion Rotate as long as key is pressed Reply To: Rotate as long as key is pressed

#14121
Gavalakis
Keymaster

    Hey,

    For chocolacode’s suggestion, you simply need to change the Check Keyboard Input from “Down”, to “Pressed”. As such the conditional decorator will evaluate as long as the key is pressed/hold.

    For my suggestion, if you simply want rotations and no movement, you can use GetInputAxis, then a “Script Control/Execute Function” task and select “Transform.Rotate(float, float, float)”. Then link the x, y, z parameters of that Rotate Function to the variables saved by the GetInputAxis. For example:

    [attachment file=”Rotate.png”]

    Let me know if either of those work for you.
    Cheers!