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 Failed to AI Blueprint

Hey, My cast to my Ai Blueprint keeps failing and i have no clue why. I just need to have an input pressed and then minus health in the AI Blueprint. ,Thanks.![alt text][1]

Product Version: UE 4.7
cast_failed.png (84.5 kB)
cast_failed.png (84.5 kB)
more ▼

asked Jun 05 '15 at 01:23 AM in Blueprint Scripting

avatar image

25 3 4 8

avatar image Duncan Dam Jun 05 '15 at 01:31 AM

when you get player pawn 0, it mean you get pawn from your player controller 0, are you sure that a correct 1, also if you are in player controller blueprint just get the pawn from get Get Controlled Pawn

avatar image iTzBarathon Jun 05 '15 at 01:46 AM

Yeah, i've tried get controlled pawn along with other ones this is the only cast that seems to give me problems.

avatar image kamrann Jun 05 '15 at 08:17 AM

You can only cast an object to a type if the object is actually of that type. What is the parent class of your AI blueprint? Also, in what blueprint is the event graph you posted located?

avatar image iTzBarathon Jun 05 '15 at 10:46 AM

The graph is located in MyCharacter blueprint and my parent class is an Actor (I just copied the default MyCharacter and names it AI)

avatar image kamrann Jun 05 '15 at 12:30 PM

I don't really follow your setup, but GetPlayerPawn will return whatever pawn is controlled by your player controller - I guess your default player pawn as configured in the game mode. Presumably this is not your AI character, as that wouldn't make much sense.

If this graph is within your player-controlled character blueprint, and you want to reduce the health of your AI character, you need to get a reference to your AI from somewhere. Casting just makes an assumption about the type you are interacting with in your blueprint, it cannot actually find a reference.

avatar image Kingmarino Mar 12 '19 at 03:25 PM

Hey Guys,

I got the same problem: I've create a AI Blueprint with its own animation BP. My task is to get a hit animation of my ai when it's hitten by a blade (working with animation notifys). For this i have to cast to my Ai Blueprint, out of the animation BP and got the same problem. (missing object)

Appending to the solution above: in my case it isn't the best way to do it like that right? Because it would cast to every AI on the map. I just need the AI of the actuall Animation BP, but how do i get it?

Many many thanks

avatar image Nebula Games Inc Mar 12 '19 at 03:34 PM

Why not use an overlap event for when the AI is hit with the blade?

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

1 answer: sort voted first

I fixed it guys, Thanks for all the help.alt text

fixed.png (102.4 kB)
more ▼

answered Jun 05 '15 at 11:29 PM

avatar image

25 3 4 8

avatar image Vexar Sep 28 '17 at 10:35 PM

This is also worked for finding a placed object to cast so the UMG would have a proper reference to cast to.

(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