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"

Does having two collision components on one actor cause conflicts? Please read below for more info (lots of questions)

All C++ (No Blueprint pls) ...to be more specific, I have a pickup class that has two USphereComponents (and one mesh), one which is slightly bigger then the pickup and the other which is much larger, giving it a radius (this one is going to be used as a trigger). My goal is to create a system that when you collide with the first big collider, an event will happen where the pickups will "fly" towards the player (like in Ratchet and Clank), and when the smaller collider comes in contact with the player, it them destroys. My mesh component is the root, and i'm assigning my HealthSMCollider->AttachTo(HealthSMMesh) so that it become a child. However, for the GravityRadius (bigger collider) i didn't set it so that it becomes a child, its just a default subobject, why is it parented?alt text alt text

My pickups also have some physics enabled, when spawned they will give a random radial impulse and impulse force up. When I tell my character to ignore this collision preset(only for the GravityRadius collider) it also disables physics, and it seems to ignore the collision on the smaller collider too the one meant for the player to collide with so it can be picked up) Is this caused because it is a child of the mesh, where my other small collider is as well? Or because it is bigger and anything inside is also ignored as well.? In a nut shell, I want my character to ignore the big collider to prevent it from picking it up from such a far distance (but still be able to play events like it flying to the character) so that it does not pick it up until the player collides with the smaller one, it doesn't look right when the player can collect a pickup from 10 feet away. All help is appreciated and if you need me to elaborate more let me know, super super tired at the moment I may have forgotten something, thanks.

EDIT* I've found another way to accomplish what I've set out to do, which is telling the pickup to find the distance of the player when spawned, and after a two second countdown, it will "fly" towards the player. Which would not require another collider on the same pick up. However i'd still like to know why this is happening ^^^^^^^^^^.

Product Version: UE 4.8
Tags:
more ▼

asked Nov 13 '15 at 12:43 AM in C++ Programming

avatar image

chriis.aburto
11 5 4 7

avatar image Matthew J ♦♦ STAFF Nov 13 '15 at 07:45 PM

Hello Chriis,

You're likely on the right track and it may be caused by the hierarchy. In this situation however, I would suggest making an Actor Component for the 2nd collision (the GravityRadius) and setting up the logic for it in there. This will also be useful in the future if you make other pickups as you'll be able to just apply that component to any pickup you want and it'll automatically have the functionality.

I'm gonna test out trying to do something similar with just the two spheres real quick though and see if I run into the same thing.

avatar image chriis.aburto Nov 14 '15 at 06:54 PM

Yes that could also work, thank you. And if you've tested it out yet i'd like to know the outcome please

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

1 answer: sort voted first

I'm having trouble getting the same thing to occur but I believe part of the issue could be that you're using OnActorBeginOverlap for your delegate binding instead of OnComponentBeginOverlap for each component. In this case, I believe that no matter what component your character overlaps, as long as it's part of that actor, it'll count as an overlap and call both of those functions sequentially. You would do something along the lines of:

GravityRadius->OnComponentBeginOverlap.AddDynamic

and

HealthSMCollider->OnComponentBeginOverlap.AddDynamic

more ▼

answered Nov 19 '15 at 09:25 PM

avatar image

Matthew J ♦♦ STAFF
31.8k 526 92 417

avatar image chriis.aburto Nov 19 '15 at 09:45 PM

that makes sense, thank you very much

(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