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"

Cast to Reference

I know it's a silly question, but every time that I'm going to cast to something that's not the player I don't know which thing goes as an object reference for cast to. Edit: Another screenshot due to everybody keeps focus on warningalt text

Product Version: UE 4.11
more ▼

asked Jan 18 '17 at 05:54 PM in Blueprint Scripting

avatar image

17 8 11 13

avatar image Fjellgnu Jan 18 '17 at 06:06 PM

Hello Zukkoku.

If you read the warning message you get here, it says that 'Item' is already 'Fire Lantern', you don't need to cast!! Just saying ...

avatar image Zukkoku Jan 18 '17 at 06:09 PM

Yeah I know, just ignore dat part kkkkkkk

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

1 answer: sort voted first

You pass in the object reference that you want to cast to.

For example I'm guessing your Fire_Lantern is most likely an Actor blueprint that you made. Any single instance of that fire lantern actor that's in the map can be passed in to Cast to Fire Lantern.

Now there are numerous ways you could retrieve an instance reference to an Actor of type Fire_Lantern. It could be done using the Begin/End Actor Overlap events within blueprint Actors or perhaps you have a static number of Fire Lantern's in your level and you have a variable in your level blueprint for each Fire Lantern that you spawned into the level.

Here's a video that shows casting objects during Begin/End overlap.


I also notice you have a warnings in your compiler results tab that says Item is already a Fire Lantern so you don't need to have that Fire Lantern cast node.

more ▼

answered Jan 18 '17 at 06:06 PM

avatar image

694 24 24 55

(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