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. 

OnComponentBeginOverlap Object rotation (over time) not working correct

Hi, i'm trying to rotate an object by -90° on OnComponentBeginOverlap. But when my character enters the box collision, the object is rotating by -180° instead of -90°. Of Course i could set it to -45°, but it would still "feel" wrong... alt text

I also tried to rotate the object -90° in 1 Second over time using a timeline and a Lerp. I've set the Alpha (Float) from 0 to 1 over a Lenght of 1, but the object was rotating more than -90°. Actually its a constant issue i have with using the timeline to move or rotate objects over time from A to B. It always goes beyond the target, where it should stop... What am i doing wrong?

Product Version: UE 4.17
oncomponent.jpg (48.7 kB)
more ▼

asked Sep 07 '17 at 07:06 PM in Blueprint Scripting

avatar image

18 1 3 7

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

2 answers: sort voted first

Have you checked if your Overlap Event fires multiple times? You could use a Once node behind your OnOverlap to prevent your object from rotating too far.

OnEndOverlap you can reset your Once again, that should fix your issue.

Kind regards


more ▼

answered Sep 08 '17 at 01:15 PM

avatar image

219 2 5 7

avatar image AceD Sep 08 '17 at 04:50 PM

Thanks Schnittbrot. This was helpful. But still, i'm not happy with the results... I could get it to work, to rotate it smoothly by -90 degrees. alt text

But when i'm trying to do the same with location, it's not working. How can i set this up with location instead of rotation. It's really frustrating that a simple thing (moving from A to B in X Seconds) is nevertheless so complicated... alt text

rotation.jpg (115.6 kB)
location.jpg (117.7 kB)
avatar image Schnittbrot Sep 11 '17 at 05:34 PM

Glad I could help! Your location approach isn't bad, but there is an easier way than using a lerp + Alpha. I suppose you intend to move your item a fixed distance. For this you'd set up a new timeline, make a new track with a float value.

alt text I chose the values time 0, value 0 and time 2, value 200.

alt text This moves your actor (or any chosen) 2 meters within 2 seconds on the X-axis. Hope this might help you.

Kind regards


location-02.png (36.5 kB)
location-01.png (189.1 kB)
avatar image AceD Sep 12 '17 at 04:34 PM

Hey Schnittbrot, i got my location setup to work, but your's indeed a bit better and the movement is smoother. Thanks for that! Btw. if you didn't knew it already, it is now possible to split struct pin from vectors and rotators directly so a Break vector or Break rotator isn't always necessary anymore :)

This question can be marked as solved. Thanks!

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

Hi, well yeah Set Rotations in UE are pretty much useless, the only way for me to deal with rotation in Blueprints its through add rotation, try adding or decreasing 90 degress with AddWorldRotation instead.

PD: SetRotation auto manage your rotation from negatives and positives and blabla, weird behavior everywhere, that is why I always use Adds

more ▼

answered Sep 07 '17 at 08:21 PM

avatar image

381 9 12 18

avatar image AceD Sep 08 '17 at 01:26 PM

Thanks for your answer! I've played around with it and had set up a Timeline with a Float Track from 0 to -90 degress in 1sec, split struct pin from new rotation and connected it to the NewRotation Z (Yaw). But when i'm using "AddRelativeRotation" the rotation went wild...

(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