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. 

How to detect a collision between actors (not blueprints)

Description: I wanted the sphere (UShapeComponent) to detect collisions between actors

Observed: Detects only Character (ACharacter)

Desirable effect: Should detect actors

Class file: https://pastebin.com/f0QYkW4a

alt text

The sphere that is going to collide is the bigger one

What I've done so far: I tried OnComponentHit and OnActorBeginOverlap. The function used is OnComponentBeginOverlap

Product Version: UE 4.17
obraz.png (520.7 kB)
more ▼

asked Aug 21 '17 at 01:39 PM in C++ Programming

avatar image

1 1

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

1 answer: sort voted first

Collision for both objects have to be set to detect the other and the collision type for each object need a to be correct. Not always, but generally speaking this tends to be the issue.

Take a projectiles for example, the projectiles collision type would be Projectile under Custom Collision panel. The. It would block against all. When the collision system checks if the projectiles has hit something it first checks to see if the other actor is of a type the projectiles has said it would block against, say Pawn or Vehicle. Then it checks the other actor if it will block on a Projectile. If both are true the it generates a hit. It either one is false then it won't generate a hit.

There is a lot of information regarding collision channels out there. It can be confusing to be used to it but it works really well in practice once you get used to it.

more ▼

answered Aug 21 '17 at 02:27 PM

avatar image

296 6 7 10

(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