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"

Homing projectile to a single target

Hi. Here is what I want to achieve, and here I am, bloody stupid, because I can't set it up. I have a third person "shooter" game, where the main character basically throws a rock. (school project). If there is a single target (there will be only one target at a time) the projectile should hit this target (if other conditions are met, but that's not the issue now).

For my life I could not feed a proper value for the "Homing Target Component".![alt text][1]

On the screenshot, there is the target, which will be spawned on the map at some event, and then the main character has to hit it with the rock.

Any help please? this is kinda a mission critical aspect of the project, and here I am dumb-folded.

cheers [1]: /storage/temp/109221-capture.png

Product Version: UE 4.13
Tags:
capture.png (222.7 kB)
more ▼

asked Oct 01 '16 at 01:38 PM in Blueprint Scripting

avatar image

GyulaSoos
3 1 3 4

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

2 answers: sort voted first

You need to get a component from your target actor and set that as the homing target.

more ▼

answered Oct 01 '16 at 05:49 PM

avatar image

renderman09
162 11 12 24

avatar image GyulaSoos Oct 01 '16 at 06:03 PM

And how do I do that? Sorry, noob here. :(

avatar image renderman09 Oct 01 '16 at 06:12 PM
avatar image GyulaSoos Oct 01 '16 at 06:52 PM

Been there done that! :) I have the most recent comment there! :)

It uses a first person shooter game, and he has to select each object he wants to target later. So the actual target is set by the player. I want this to be automatically activated for the target. Scenario: Case 1: "target not present in level" - player fires, throws, whatever, the projectile goes where it is supposed to as per specified in it's settings. Case 2: "target spawned in level" - player fires, and projectile automatically goes and hits this target. any ideas?

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

Given that this was back in October, I'm going to assume this issue is either resolved or no longer a primary concern for the school project, but I have an answer to your question regardless.

In blueprint there's a node called "Get All Actors Of Class", which gives you an array collection of all actors of that type in the scene. Set it to your enemy actor class, and drag off the return node (the little array square), choose "Get" node, and leave it at index 0. This will give you a reference to the first (and according to your scenario, only) enemy in your scene.

From there, you drag off of that enemy actor reference, type in "get" again, and at the bottom will be a section of components for that enemy, such as the capsule collider. You can then plug that component into your "Homing Target Component" for the projectile movement.

That said, I'm still trying to figure out how to make the projectile properly home in on the target myself, which is what led me here.

Best regards and best of luck to you. ^_^


Edit: Figured out where I messed up the homing part. If the Projectile Movement's "Max Speed" is at 0, it can infinitely accelerate, making the homing inaccurate, tending to over-shoot. Make sure there's a Max Speed value for homing projectiles, somewhere around 3000 - 5000 is working well for me.

more ▼

answered Jan 16 '17 at 11:25 PM

avatar image

Last_Mavrik
17 4 6 8

(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