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 do I make accurate homing projectiles in blueprint?

I know there is the homing thing in the Projectile Movement component, but without using that, through Blueprint, how do I make accurate homing rockets?

The code I have right now -kinda- works. (is attached) It moves my actor toward the target, but it rarely hits on point. I have some initial impulse velocity in the construction script for when my missile spawns.

What I'm doing at the moment, is when I shoot, it creates a trace and whatever the trace hits will become the target location where I want my missiles to go. This code does that, but not entirely accurately. Most missiles miss and swirl around the object until it hits.

If someone could give me some pointers I'd greatly appreciate it! Thanks!

alt text

Product Version: Not Selected
homing1.png (154.9 kB)
more ▼

asked Feb 08 '15 at 05:33 AM in Blueprint Scripting

avatar image

214 12 11 26

avatar image alperenakyuz Feb 08 '15 at 06:21 AM

It doesn't look much like a rocket since you're not rotating the projectile as well. What I would do is to get the look at rotation as you did and change the rocket's world rotation by lerping between its current world rotation and the look at rotation you find. It's a minor difference but it's how they do it in real life, so it will probably work.

avatar image Maverinox Feb 08 '15 at 07:02 AM

Thanks for the response and suggestion!

The results appear to be the same as what I had. It does make it look a little better, and the missiles do get closer, but it still misses.

I've attached the suggestion you said, and added a current temporary solution. This solution still misses initially, but at least it makes the missile hit the target for sure when it loops back.

I still am not sure of a true solution. alt text

avatar image MaroonersRockAnimation Jan 15 '16 at 06:22 AM

Under Homing in ProjectileMovement, make your "HomingAccelerationMagnitude" about 10 times larger than your projectile speed. So if your initial projectile speed is about 1,500, make you HomingAccelerationMagnitude 15,000. It worked for me. Good luck!

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

1 answer: sort voted first

Sorry to necrothread, but this one creeps in so easily and is a simple fix.

Double check the Projectile Movement Component, the X, Y, Z vectors. The X is usually set to 1000 by default, and this gets incorrectly added to the homing calculations, so objects tend to circle forever or this force may be jerkily overcome with sufficient maginitude (not sure, but likely).

I hope you solved this, it might be worth zeroing out the vectors on the component automatically if homing is switched on

The deeper I get into projectiles, for unusual purposes, the more I'm liking them. I'm gradually figuring out ways to make them smoother and more blended in velocity and rotation :)

more ▼

answered Sep 15 '16 at 09:30 AM

avatar image

1.1k 9 17 20

(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