Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Subtract Two Floats Over Time(Smoothly)?

Hello, I have a very simple BP which triggers an event every 2 seconds. And that event gets the collision capsule rotation (yaw value) and substracts the control rotation(yaw value) from it. alt text

This results in an instant snap of capsule to rotation wanted. How can I make it so that capsule rotation rotates smoothly to the yaw value wanted? I tried using timeline, lerp and Rinterp to nodes but they didn't quite work or I did something wrong.

Thank you for any suggestions/responses.

P.S. use pawn control rotation is checked off so mouse inputs shouldn't be an interuptor in this case

Product Version: UE 4.17
smoothrotate.png (202.7 kB)
more ▼

asked Sep 15 '17 at 02:13 AM in Blueprint Scripting

avatar image

13 3 5 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The Problem is that you trigger only every 2 seconds. Instead of Rotating there do your rotation on Tick. In your Timer you can simply set a Float variable to hold the Yaw rotation you want and use that Variable in your tick. You can use interpolation for this.


Good Luck and have Fun =)

more ▼

answered Sep 15 '17 at 02:21 AM

avatar image

6.9k 143 26 172

avatar image Xenomorpheus_X Sep 16 '17 at 12:50 AM

Hello Nachtmahr. Thank you for your prompt reply. I tried many ways but no help. what I might be doing wrong? alt text

alt text

smoothrotate2.png (181.7 kB)
smoothrotate3.png (158.0 kB)
avatar image Nachtmahr Sep 16 '17 at 01:11 AM

Hi there Axe the Problem is the same you call it only every 2 seconds from the timer. You have to move your Code to tick. Interpolation and AddLocalRotation needs to be there.

avatar image Xenomorpheus_X Sep 16 '17 at 04:44 PM

Hello back Nachtmahr. Moving the code (AddLocalRot and Interp) to tick made rotations smoother but it causes character to rotate with mouse every frame. What I have is character moves his head(Not the whole character) with the mouse. What I am trying to do is to rotate the whole character to the rotation of the control rotation (Head bone) every 2 Seconds so that is is more realistic. Please excuse my lack of experience in this game engine and coding.

Thank you for answering my questions Nachtmahr.

avatar image Nachtmahr Sep 16 '17 at 06:52 PM

No Problem man here is a Screenshot of what you want.


avatar image Xenomorpheus_X Sep 16 '17 at 07:44 PM

@Nachtmahr, Thank you man, it worked nicely. I very appreciate your help and support!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question