x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Why does casting from Game Mode to my bot's AI blueprint always fail?

I am trying to set up a respawn system. In the game mode blueprint I connected Event Begin Play to a cast to my AI but it always fails. Why?

Product Version: Not Selected
Tags:
untitled.png (292.3 kB)
more ▼

asked Apr 06 '15 at 03:14 AM in Blueprint Scripting

avatar image

JKLolling
1 1 3 2

avatar image Cobryis Apr 06 '15 at 04:23 AM

You are casting the default object for a botAI as a botAI, which really doesn't make any sense. Casting takes an object of any type and tries to give you it to use as a botAI. However, to begin with, you're not giving the cast an object. Furthermore, I don't think Begin Play on Game Mode is where you want to be doing whatever you want to do. If you are wanting to "spawn" a botAI, you use SpawnActor on Begin Play, and then tell it to spawn a botAI type.

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

1 answer: sort voted first

Casting is sort of converting some data type to another, this means you have to cast something TO something. From your description it seems you have a cast node with just the exec pin plugged into EventBeginPlay which will not do anything. If you are trying to spawn an AI pawn then you can use a SpawnActorFromClass or SpawnAIFromClass. SpawnActor is just an actor that will need to have an AIController assigned to it while SpawnAI will spawn an actor and create a new AIController and assign it.

more ▼

answered Apr 06 '15 at 03:05 PM

avatar image

RimmyD
2.6k 98 15 96

(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