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"

Why is the Battery Cast to Flashlight failing?

I have made a flashlight Blueprint. I have a custom event in it called batterypickup. I have a blueprint of my battery. In it I have event actor begin overlap - cast to flashlight - batterypickup (target is flashlight) I also have an amount (float value) that I want to send to my flashlight.

Thanks for all the help I can get :)

alt text alt text

Product Version: Not Selected
fl01.jpg (227.7 kB)
fl02.jpg (224.7 kB)
more ▼

asked May 06 '14 at 06:35 PM in Blueprint Scripting

avatar image

1 2 5 6

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

1 answer: sort voted first

Hey Athidi,

The Event Actor Begin Overlap is passing Other Actor when that event is triggered. Other Actor is likely your Character blueprint that is walking over the pickup/triggering the Event. Casting your Character to the Flashlight probably should fail in this case because the Character isn't a Flashlight--is your Flashlight a blueprint you are spawning and attaching to a socket on your Character?

Let us know and we'll be able to provide more guidance.


more ▼

answered May 06 '14 at 07:13 PM

avatar image

Steve Allison STAFF
4.3k 123 58 209

avatar image Athidi May 06 '14 at 07:17 PM

Hi. Thanks for the reply. The flashlight is beeing snapped to character as he walks over it.

Any good solutions for how I could set up seperate blueprint for battery, and flashlight ?

avatar image Arshia001 May 07 '14 at 09:46 AM

You should already have a reference to the flashlight in your character, right? Create a function in your character that will return the flashlight object (GetFlashlight would be a good name), and call it on the character to get the flashlight.

Also, it would be better if you had the character handle pickups and then redirect them to their respective users. In this case, you'd have a HandlePickup function in your character which tests to see what type of pickup was acquired and if it's a battery, tells the flashlight to increase its remaining power.

(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