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"

Get Overlap Actor Vs Cast to BP

What setup should i use to say... add ammo to player through a ground pickup.

I want to be able to walk over a pickup and have it resupply ammo.

If i cast to say a sepcific blueprint.. then.. when another blueprint runs over it.. some guy across the map is going to be like.. "Wow.. i just Got Ammo for nothing... sweet"

So how can i make an overlap event do its work to the specific blueprint that is overlapping it?

Product Version: UE 4.10
more ▼

asked Feb 24 '16 at 10:50 AM in Using UE4

avatar image

15 6 9 12

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

1 answer: sort voted first

That's not quite how casting works. Casting is kinda like saying "try to use this object as this other type", it doesn't refer to another object elsewhere. It's generally used in cases where you have a reference to an object's parent type (like how Event ActorBeginOverlap gives you an Actor reference) but you want to use that reference as a specific child type of that type (for example, SoldierActor). If every actor that can pick up your ammo has a common parent you've defined which should ideally have your ammo variable in it, you can cast to that type, and apply the extra ammo to the variable via that reference.

You still feed the overlapped actor reference into the cast, so there's no danger of referencing a random object somewhere else. The only issue is if you try to cast to the wrong type it'll trigger the 'failed' pin instead of the regular top one.

more ▼

answered Feb 25 '16 at 02:54 AM

avatar image

186 4 7 13

(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