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"

ProjectileMovement Component: Velocity

Hi! So I'm trying to make a bow and arrow system where I spawn in an arrow and depending on how long the player holds the left mouse button it changes the velocity of the arrow.

When I tested the arrow I set the z velocity to something like 2000 press play and the arrow flies up in the air. If I rotate the arrow sideways, press play, the arrow flies in the direction it's pointing, great! But when I place the arrow into a level with z velocity = 0, increment a float and do a branch to check if it's at 2000 or not, and if it is I set the z velocity to my new float, the arrow always goes up(along the z axis), it doesn't follow the direction of my arrow, why is that? :P

Any help would be greatly appreciated!

https://imgur.com/TPucoTx #spaghetticode

Product Version: UE 4.19
Tags:
more ▼

asked May 05 '18 at 12:31 PM in Blueprint Scripting

avatar image

Halvdur
3 1 4

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

2 answers: sort voted first

Fixed it, changed the "Set Velocity" to "Set Velocity in Local Space" and that worked. I figured it had something to do with the rotation. Am I correct in assuming that when the arrow component has it's velocity set before I press play, the rotation is "already calculated"?

Anyways, hope this helps if someone else has the same problem :)

https://imgur.com/tTB6mRs

more ▼

answered May 05 '18 at 01:02 PM

avatar image

Halvdur
3 1 4

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

Another solution would be to set the "Initial Speed" of the projectile movement instead of what you did. Set the rotation to the player control rotation and all will be fine. Don't set directional velocity (x, y and z)

Hope that helps :)

more ▼

answered May 06 '18 at 06:45 AM

avatar image

Kit Kat134
198 1 8 8

avatar image Halvdur May 06 '18 at 11:36 AM

That didn't work for me, but I'm spawning the arrow, holding it still, then releasing it. Does initial speed decrease in time maybe?

I tried replacing "Set Velocity in Local Space" with "Set Initial Speed" and when I released the arrow it just fell down like it didn't receive any velocity at all :P

Thanks for the tip though, my system is probably set up wrong for it to work x)

avatar image Kit Kat134 May 07 '18 at 09:24 AM

Oh.

Set initial velocity has to be set either as the arrow is spawned or before. Sorry i did not understand exactly what you were trying to do

(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