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"

What is the difference between OnActorHit and OnComponentHit?

I feel both of them are the same, have the same functionalities, and can accept the same delegates.

What makes them different among themselves? Thanks in advance.

Product Version: Not Selected
Tags:
more ▼

asked Mar 24 '15 at 01:48 AM in C++ Programming

avatar image

asperatology
293 30 30 91

avatar image ymars STAFF Jun 22 '16 at 07:08 AM
(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Think of components as being children of Actors.

Imagine an actor that represents the car. Pretend the root object is the car body and each wheel is a component. If you wanted to get a hit event from the car body, you would use OnActorHit. If you wanted to get hit events from the wheels you would use OnComponentHit.

You couldn't use OnActorHit to get hit events from the wheels because they aren't actors, they're components of an actor.

more ▼

answered Mar 24 '15 at 03:23 AM

avatar image

hyperdr1ve
583 26 51 117

avatar image asperatology Mar 24 '15 at 03:26 AM

So, only if the actor has only 1 component, both OnActorHit and OnComponentHit will have the same function?

avatar image hyperdr1ve Mar 24 '15 at 03:35 AM

I don't know if you can add a dynamic OnComponentHit for a root component or not. I've never tried, but I think it would be equivalent since the root component is technically a component. It's probably just easier to think in terms of the collision geometry that you have. If your root component is a SphereComponent with collision enabled then OnActorHit.

If your root component is an arrow component and all the collision bodies are underneath it, then OnComponentHit.

avatar image asperatology Mar 24 '15 at 03:36 AM

Thank you for clearing this up for me.

(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