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. 

Homing Projectile in Multiplayer Not Working

My blueprint for homing projectile looks like this, Executes On Server Custom Event -> SpawnActor MyHomingBomb -> Set HomingTargetComponent to target character's (another player) Capsule Component

And my questions are

  1. At server game instance the homing bomb moves towards the target character but it does not hit the character, it's hitting very near the character but not exactly touching it. MyHomingBomb's on hit event was triggered but the hit actor is not the target character! What caused this?

  2. Is a character's Capsule Component the correct component to be use for HomingTargetComponent?

  3. At client game instance the homing bomb does not moves towards the target at all. MyHomingBomb's replication is already set to true in fact MyHomingBomb was duplicated from my another projectile bp MyBomb (no homing) which was working nicely in both server and client game instance. Again what caused this? Looks like MyHomingBomb's movement is not replicated correctly...

Product Version: UE 4.12
Tags:
more ▼

asked Jul 31 '16 at 05:46 PM in Blueprint Scripting

avatar image

edwardkoo
43 8 7 11

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

1 answer: sort voted first

1 and 2 are actually the same answer funnily enough.

The capsule component is NOT your character. It's what's used for movement collision. You can turn it visible during the game (in your character blueprint, select the capsule component in the viewport and under rendering untick "hide during play".

You can see it's around your character but it's a bit beyond it.

3 is a bit different. I'm not too familiar with the homing component and couldn't tell if it has something to do with that component itself. But is your "Replicate Movement" box ticked?

more ▼

answered Jul 31 '16 at 07:50 PM

avatar image

Erasio
5.9k 291 86 293

avatar image edwardkoo Aug 01 '16 at 05:16 PM

I have found the solution for no. 1 by setting Homing Acceleration Magnitude to 10x of Initial Speed. The projectile can hit right at the character now.

As for no.2 so what's the best component parameter to pass as HomingTargetComponent since the character capsule is not the most accurate?

Yes Replicate Movement is enabled. Anyway, I have found the reason for no.3 it is due to the homing projectile were spawned in server event and when replicated to the client the HomingTargetComponent which used the target character capsule's object reference is not valid in client's game instance as the memory pointer of the capsule is difference. The client has access to target's PlayerState but the question now is how could I get PlayerCharacter from PlayerState?

avatar image Erasio Aug 01 '16 at 05:34 PM

For two: Well if you wanna hit the visual representation of your actor maybe the mesh?

avatar image edwardkoo Aug 02 '16 at 04:06 PM

I tried mesh and the projectile moves into target's feet... looks like capsule is the better option. I'll just stick to capsule for now. Thanks anyway.

(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