How to rotate an object in the negetive trend?
Hay guys i'm new with BP scripting ,i wanted to try to make a game where the plane rotates left and right with different keyboard inputs but when i have used the Add Local Transform Node all it can add is positive rotation so i can't rotate it on the left any ideas?
asked Aug 29 '15 at 03:08 PM in Blueprint Scripting
You have not written as should rotate your object. So I created an example in which the object is rotated to the right or left until the key is pressed.
Enable Input necessary for an object to respond to button presses.
Rotation is a speed of rotation.
answered Aug 31 '15 at 11:39 AM
You instead of using AddLocalTransform, if you just want to change the rotation, use AddLocalRotation (or relative suiting your need). So you can make your object turn Pitch 0 Yaw 45 Roll 0 by pressing H and 0 -45 0 byt pressing G (let's say ^^). Also, if your actor is a pawn, maybe it's better to use AddController Yaw Input.
And last advice, when dealing with multiple values pins (rotation, vector, transform, color...) you can split them by right clicking them and select "Split Pin Struct". That will give you float pins, except for the transform, as it contains Rot,Loc,Scale, you will have to split them again. But it can be pretty usefull when it comes to use a function that use transform and you don't need to specify it (or only one sub element).
For exemple, when you use Spawn Actor from class, it asks you the spawn transform, and if you dont do it you will get an error, so split it, and he will take the default values (0 for loc and rot, 1 for scale). It avoid creating a variable or putting a "Make Transform" that will add little mess to your graph ^^ But i'm going off subject so i'll stop here ^^
Follow this question
Once you sign in you will be able to subscribe for any updates here