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 can I make a projectile follow me in all directions, like a homing missile?

I'm stuck creating a projectile. Currently I can make the projectile shoot at me, but only in one plane. The "barrel" is located much higher than my character and I want to have it shoot down at me.

Also, how can I make the projectile home onto me until it hits?

Currently my blueprint looks like this (also image showing my issue - the projectile is above and went past the pawn):

http://i.imgur.com/MM1cjH1.jpg

Product Version: Not Selected
Tags:
more ▼

asked Jun 08 '14 at 09:44 PM in Blueprint Scripting

avatar image

RiotNOR
11 2 5 5

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

2 answers: sort voted first

You could have it moving forward and turn towards the player with the look at rotation from the projectile to the player and Rinterp to that however fast you want it to turn.

more ▼

answered Jun 08 '14 at 11:28 PM

avatar image

16bit
329 7 8 12

avatar image RiotNOR Jun 08 '14 at 11:49 PM

Would it be possible to get a more indepth look at your explanation? Most of what I've learned thus far has been from tutorials. I'm not yet able to do simple stuff like this at a whim, sadly.

avatar image 16bit Jun 09 '14 at 12:38 AM

alt text

Each tick it turns the projectile towards the player at a rate specified by how strong the homing is. Since this is a LoL type statue the homing strength should be pretty high.

It then moves the projectile foward as many units as its speed is.

avatar image RiotNOR Jun 09 '14 at 01:48 AM

I put your blueprint into the projectile blueprint. While the turret blueprint says it's firing, the game no longer spawns any projectiles meaning it's not actually firing.

No clue if I should put it into my turret blueprint instead as I have no clue how to interpret your bp into my own.

EDIT: Lowered homing- and projectile speed and the scene outliner now correctly states that a projectile gets spawned. They are, however, invisible.

avatar image 16bit Jun 09 '14 at 01:55 AM

This should go into your projectile that's fired BP, can you show me a pic of the component tab? I can fire mine from my character, albeit they just home back to me.

avatar image RiotNOR Jun 09 '14 at 02:12 AM

I put it there. For some reason they were invisible.

Here are the component tabs for the projectile (left - Bang) as well as the turret (right - turret_actor) http://i.imgur.com/bFaCME5.jpg

avatar image 16bit Jun 09 '14 at 02:23 AM

Turn off projectile movement, I couldn't get it to home with it. Unless your projectile needs some kind of physics like gravity.

-edit-

I dont know if that will help with the visibility, but it might? I don't know why it would make it invisible.

avatar image RiotNOR Jun 09 '14 at 02:26 AM

Tried that, but that's not the issue. The BP you wrote seems to be working but the projectiles are seeminly invisible. They do get spawned as indicated by my scene outliner getting filled up (no destroy at the moment). They aren't stuck colliding with the mesh either as they have collision set to none.

EDIT: Found them. They are shooting but appearing under the BSP. Not shooting from the socket. Hmm. EDIT 2: Not appearing when playing. Only under simulation when it has no one to shoot at

avatar image 16bit Jun 09 '14 at 02:29 AM

Not sure, drag a projectile blueprint onto the level and see if it disappears or shows?

Check for scale, wireframe, something like that. Perhaps they are not spawning in the right place and might be somewhere else in the scene.

Find the ones that spawn and pause the game and focus on them from the scene outliner.

avatar image RiotNOR Jun 09 '14 at 02:38 AM

They are just getting spawned below the bsp and not on the socket that the firing event/spawnActor is at.

avatar image 16bit Jun 09 '14 at 02:41 AM

Are they visible?

avatar image RiotNOR Jun 09 '14 at 03:02 AM

Yes. Just the wrong spawn. It should be the socket "turret_fire" on the "bang" blueprint.

avatar image 16bit Jun 09 '14 at 03:06 AM

I don't know if this is useful, but on your fire part of the code, its set to spawn at a socket, but on your turret, its a component, why don't you set the transform to the "bang" component transform?

So set up a get node from

bang > get world transform > spawn actor

-edit- world transform, my bad.

alt text

The shots fire from my hand.

avatar image RiotNOR Jun 09 '14 at 03:25 AM

The same thing happens. Gah. I guess this just isn't happening.

EDIT: Saw your second edit. That's not what I'm trying to do. I can make it fire just fine. If you look at the first post, I just need to make the projectile home in on my character. It finds my rotation but it doesn't shoot downwards. It just shoots the projectile towards my location on the same plane.

EDIT2: Alright! I am the dumbest person alive on this earth. I seem to have not connected my clamp angle to my pitch... In any case, just homing left. :x

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

Try the Find Look at Rotation math function. It returns a rotator that you can poke into the rotation part of the transformation of your weapon/missile.

more ▼

answered Jun 09 '14 at 02:06 AM

avatar image

jwatte
1.3k 48 42 88

(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