Homing Projectile

I am trying to create a homing projectile for a game I am making. I followed this tutorial; :https://www.youtube.com/watch?v=CVlgaU45IW4&t=37s, but my projectile just fall down and doesn’t do anything. Could I get some help on fixing this?



How do we know what we’re homing at? How do you choose which actor?

my projectile just fall down

Disable gravity


Also, add a sphere collision at the root or drag the static mesh to the root, otherwise you’ll have issues with the Projectile Movement component / physics and collision in general:

@Everynone is dead on about the component structure.

  • Collision (Root)
  • mesh (child of root)… NO COLLISION
  • PMC

Homing target has to be Set and passed in via exposed pin on the Spawn Actor node. Validate that it’s not empty.

how would I do that?

Create a variable in your projectile called HomingTarget (SceneComponent obj ref)
Set it as exposed on spawn and editable.

In the construction script take the homing target var and Set the PMC → Homing Target Component.

Spawn actor from class (your projectile class), the homing target pin will be available.
Get a reference to the target, then get a reference to its scene component. Pass that reference to the homing target pin.

Also note the PMC setting for Homing Acceleration Magnitude will need to be tuned.

The target will need a decent sized target collision. Homing isn’t pin point accurate by any means. If the target is moving sporadically there’s a good chance the projectile will miss.

Helped someone here with a homing disc. You could probably dig that thread up.

I don’t see the exposed pin on the spawn actor node/ How do i get to that

You already have it:

You never answered the original question. What is Homing Target above? How do you know which actor you want out of the 1000 actors in the scene?


And this:

n

Should be in the Construction Script, ideally.

The homing target was selected in the scene.

1 Like

it’s called bp_homingTarget

1 Like

We’ll then need to see the details panel of the Projectile Movement Component.


It is enabled.

Blueprint Runtime Error: “Accessed None trying to read property Homing Target”. Node: SpawnActor BP Homing Shot Graph: EventGraph Function: Execute Ubergraph BP Third Person Character Blueprint: BP_ThirdPersonCharacter

gravity is set to 0.0

It means the reference is not set correctly. When you click the error, which node does it take you to?