x

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"

Making a Snake shot projectile

Hello. Im wondering how i could create a projectile that moves toward the players position in a snake style moving.. I was thinking maybe adding a sine curve in the XY plane to some vector but i am not entirely sure what exactly to use. Hoping for some help with the math :)

Edit: something like this :3 alt text

Product Version: UE 4.9
Tags:
snake shot.png (3.8 kB)
more ▼

asked Sep 09 '15 at 10:08 PM in Blueprint Scripting

avatar image

Mr-Manly
19 7 8 11

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

A possible solution would be to move the projectile along a SplineComponent: obtain the next position to move the projectile to ( by setting the Location of the Projectile to the value returned by SplineComponent.GetLocationAtDistanceAlongSpline ) and make the projectile to face the direction of the spline ( by setting the Rotation of the Projectile to the value returned by SplineComponent.GetRotationAtDistanceAlongSpline ).

more ▼

answered Sep 10 '15 at 03:38 PM

avatar image

Keno
51 3 4 6

(comments are locked)
10|2000 characters needed characters left

I would divide the distance from the player (ignoring the Y axis in your picture, but whatever axis it is going to be swerving along) by the distance from the player to the target. This will give you a value between 0 and 1. Sine this and you'll end up with a sine graph. You may end up having to do some manipulation of your input, but you'll at least get a sine graph that way. I think with this way you'll only get one direction of the loop.

more ▼

answered Apr 05 '16 at 09:29 PM

avatar image

Sessional
46 3 7 10

(comments are locked)
10|2000 characters needed characters left
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