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"

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. 

How do I make a projectile automatically target a StaticMeshActor?

How do I make a projectile automatically target a StaticMeshActor? I don't want to target it myself, I want to target the nearest MeshActor to the projectile. I'm having a really hard time finding some help.

Example: https://youtu.be/MzIe8llRimc?t=26m4s

See how it targets the cup without actually pulling the trigger to target? EDIT: I solved it.

Product Version: UE 4.17
Tags:
more ▼

asked Aug 23 '17 at 10:36 PM in Blueprint Scripting

avatar image

Douwert
1 1

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

1 answer: sort voted first

Uhm, you might be able to do this by creating a hitbox around the projectile that you shot and make the hitbox really big, then when it overlaps with the static mesh just lerp the projectile to the static mesh.

But if u want the projectile to go towards the target closest to the player. https://forums.unrealengine.com/community/work-in-progress/18694-alice-in-tokyo-wonderland-blueprint-only-action-hack-n-slash/page3?47183-Alice-in-Tokyo-Wonderland-Blueprint-Only-Action-Hack-n-Slash=&viewfull=1

Or maybe you could just make a line trace from the center of the screen and see what mesh is closest. I think you might need to make whatever mesh you wanna home in on, a bp.

Or maybe you could put an invis collision box infront of the player camera and whenever you shoot a projectile line trace to all the different hit able objects in the scene and if the line trace goes through the hit box then home into that object.

more ▼

answered Aug 24 '17 at 08:36 PM

avatar image

CurryCo.
3 2 2 5

(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