How would I increase a value in relative to the rotation?
I'm just wondering how I would have say a float variable: currentRotation = 0 and increase it by 1 for every degree my character rotates to the right (in first person) and decrease it by 1 for every degree to the left? I done this in Gamemaker before to align the movement with the sprite but I can't figure it out in UE4. It's simple but I don't know if it can be done through blueprints.
I tried using the mouse axis that I added in the settings but that always gives weird values (ex: sometimes +1, other times +5, etc). Sadly I don't have any blueprints to show because I was just messing around with UE4.
asked Apr 30 '16 at 07:20 AM in Blueprint Scripting
Hi man , i know unreal is not the most easy software on earth. some easy thing came out really complex sometime. I dont catch why you want to to this and how you want to procede once you char go 180° or make a full turn on the right. You can easily track the amount passed out from the mouseX, Y if you use them for the rotation of the char. Just make a variable and add the amount passed by those events (mouseXY). They work so , for every tick , the pass you the amount of movement of the mouse. If you dont move they pass you 0, you move slow, they pass you 0.2 , if you roll away the mouse 4 5. When you read the value you can have any number.
If is <0, you turned left. , if is < -180 you made at least 1 full turn on the left.
If is >0 you turned right, if is >+160 you made at least a full turn on right.
Its a bit Tricky...
Lets say that you can break the rotation of your actor anytime, and get a value from Z that go from -179 to 0 to +179. You cant count the full turn , but its usefull.
I often have to change back my project because i found that flipping all the problem upside down its more easy than solve some logic-problem. So dont be too obstinate , try also to avoid the walls on the way.
answered Apr 30 '16 at 12:14 PM
Hi man , here an example. as you can see i can say how much rotation was given to the actor reading the VAR_R. lets say a crazy thing, i have rotated a lot the actor and the value show 3333. I can divide the 333/360 and get 9.2... i have done 9 full turn on the right and 2/10 of another turn.
By the way reading for what you want to do . You can surely take a look at Nick Jackson post. I think you can also do this. Once you jump, save your vector in a variable (Start_Jump_vector). Now from there on, during the jump. Get the starting_Jump_vector and sutract it to your current vector. Then use the Lenght vector node , to the output. This will give you a float. that will be Greater as you turn away from the starting vector. Just use that to decrese what you want, and be sure to set every time the start jumping vector, to the current. You are Always working costantly . (tick_event)
answered May 01 '16 at 01:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here