Object error when casting to enemy character BP
Hi guys probably an obvious mistake with my graph here but I need to cast to my enemy character BP to play some animations and stop movement in a different blueprint. Got a screenshot showing the cast and the error when compiling. If you need more info to help me just ask. Appreciate any help Thanks.
You got the Concept of a Cast wrong, a Cast wont get you something out of thin air.
A Cast simply takes a Object and Cast it to a Specific Type. Like you can have a Variable that Holds a Controller or anything that is a Child of Controller, but your BP only knows its a Controller and not if its a AIController or PlayerController or any other Controller Type. But if you take that Controller refference and Cast it you basicly asking is this Controller Refference a AI Controller. If Cast is a success it is indeed a AI Controller und you can access all public variables and Functions it has.
In your example you probably have already somewhere a Pawn ref earlier in the graph you can get the the Controller from there and put it in the Object Pin of your Cast.
I Highly recommand you to watch this Training Video to get the Basics down https://www.youtube.com/watch?v=EM_HYqQdToE
Good Luck and have Fun =)
answered Jun 03 '16 at 06:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here