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 do I apply damage when specific components of two actors touch?

Okay, so in my game I have a ship pawn that's made of several components.

In the center is the actual ship itself, then there's a flat plane with a texture applied that creates a sort of glowing shield around the ship.

I have it scripted so that if any enemy overlaps the shield, it applies a certain amount of damage per second.

I want to have it so that if the enemy ship overlaps my actual ship (not the shield) that it applies damage to the player ship.

I've tried OnHit events, but they seem to work sporadically, and only if the player ship is moving around.

I've tried overlap events, but I can't get it to apply damage only when overlapping specific components.

TLDR: How do I apply damage when specific components of two actors touch?

Product Version: UE 4.10
Tags:
more ▼

asked Mar 07 '16 at 05:05 PM in Blueprint Scripting

avatar image

Lone_Rebel15515
6 5 6 11

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

The solution is "On Component Begin Overlap".

With that function you can determine a component of your actor AND get the "Other Component" so you can check if it is a shield / ship or something else.

So basically check "on component begin overlap (ship)" IF "Other Component" EQUALS "Shield" -> Deal Damage.

Cheers!

more ▼

answered Mar 07 '16 at 06:47 PM

avatar image

Erasio
5.9k 291 86 291

(comments are locked)
10|2000 characters needed characters left
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