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"

How to fire

I want my turret to fire in any direction. At first, it aims character, than gets permission and spawns a bullet, which has an impulse in own blueprint. Please help me to teach the bullet to fly in correct direction. Thanks!!!!

Product Version: UE 4.19
Tags:
more ▼

asked Jul 11 '18 at 09:47 PM in Blueprint Scripting

avatar image

RenegadeCash436
1 1 3

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

2 answers: sort voted first

Hey try looking here for a simple FPS tutorial https://www.raywenderlich.com/182606/create-simple-fps-unreal-engine-4

The idea behind shooting turret is the same as shooting gun in FPS. Only difference is that you first need to detect whatever you wanna shoot at, then rotate your turret to face the target (for example use Find Look at Rotation) and then shoot.

Hope it helps

more ▼

answered Jul 11 '18 at 10:01 PM

avatar image

ex3me
53 2 5

avatar image RenegadeCash436 Jul 11 '18 at 10:13 PM

Thank you very much, but it is not what i actually need. There is example with linrtrace. I can spawn a bullet in corrrct place and rotation, but not to make it fly in correct direction

avatar image ex3me Jul 11 '18 at 10:30 PM

I think all you need then is just to give the bullet a correct velocity to jumpstart it.

  1. Attach UProjectileMovementComponent to the bullet (https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/UProjectileMovementComponent/index.html ), this will allow you to use physics.

  2. Set projectile velocity on UProjectileMovementComponent by using SetVelocityInLocalSpace method

  3. Activate the UProjectileMovementComponent using Activate method, this should fire the bullet

Using UProjectileMovementComponent allows physics engine to take care of the bullet movement, if you are rotated in direction of your target use Forward Vector * BulletSpeed, to set the correct velocity. Hope this is what you needed.

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

Here is a tutorial I made that walks you through how to shoot a moving player. Is this more what you are looking for?

https://youtu.be/jEKwv0i9B3k

more ▼

answered Jul 11 '18 at 10:17 PM

avatar image

Nebula Games Inc
2.8k 15 8 9

(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