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"

Getting a smooth sine wave movement

I'm trying to make the enemy go down in a sine wave movement (a smooth zig-zag), the things highlighted in the red box are the problematic part, the enemy currently goes downwards to the right diagonally and never goes to the left like I imagined it should. I've tried messing with the numbers, but it still went downwards to the right. I appreciate all the help. alt text

Product Version: UE 4.17
untitled.png (160.6 kB)
more ▼

asked Apr 29 '18 at 07:34 PM in Using UE4

avatar image

3 1 2 5

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

1 answer: sort voted first


your sine is constants, so your Y is always 0.099 x 1000 = 99. That's way your actor move only in right. Try to connect GetGameTimeSinceCreation or GetGameTimeInSeconds to your sine. I think you get a better result when you use cos instead of sin. You can also move your actor through AddActorLocalOffset.

alt text

blueprint.png (102.7 kB)
more ▼

answered Apr 29 '18 at 09:42 PM

avatar image

341 2 7 5

avatar image SpookyBoris Apr 29 '18 at 10:12 PM

I appreciate the time and effort you put in to this, thank you so much, it works the way I wanted it to now :)

(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