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 block off collision?

Say there is a brick wall with items on either side of it. I have a trigger volume (sphere) attached to my player actor. When this volume overlaps with an item, it will be picked up.

Obvious problem is that the object on the other side of the brick wall will also be picked up if the overlap occurs, as said wall does not block the player's sphere. This problem persists even if I set it to block the sphere's collision channel (or BlockAll).

I'm guessing that I should be sweeping for pickups instead, but I am lost on how to do it. I'm also wondering why included in OnOverlapBegin()'s parameters is a sweep boolean and a hit result--how do I use those?

Generally, what should I be doing to solve this problem?

Product Version: UE 4.8
Tags:
more ▼

asked Aug 16 '15 at 06:47 AM in C++ Programming

avatar image

sgp
166 32 43 56

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

1 answer: sort voted first

if you cant reduce the radius of the sphere, you may need to do another trace based on the spheres results to determine if actually is reachable.

take the hit result, break hit, do a line trace from the players position to the actor pin from the "Location", but set the line trace to detect the wall, if the resulting vector is >= than the vector to the object set a bool reachable=true, if the vector is shorter reachable=false.

but would really be way simpler to just reduce the spheres radius.

more ▼

answered Aug 16 '15 at 07:29 AM

avatar image

MrGrr
986 34 3 41

avatar image sgp Aug 17 '15 at 05:17 AM

Didn't follow your instructions perfectly but Line Trace was what I was looking for, thanks. Just curious: How would reducing the radius of the sphere help? Do you mean that as a way to prevent the sphere from going through the wall? I want to be able to pick up everything within a certain radius independent of what blocks my way--it could be a thick wall but it could also be a thin piece of cardboard.

(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