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"

Access Actor being controlled from AIController

I have an Actor being controlled by an AIController. I am also running a behavior tree with a blackboard. The BT is working and my A.I is moving correctly. However, I want to set up a value in the Blackboard. I want to get this value from the actor the A.I is controlling.

I can't seem to be able to access the controlled actor from the my AIController class. "Get Controlled Pawn" Returns none. Also, from my actor blueprint , "Get Controller" returns null. It's like they're not linked even though the actors are clearly following the behaviour tree of my AI Controller.

EDIT :

I've found a workaround for my issue, but i still have no actual solution to it. What I've done is that instead of trying to set the values in my blackboard from my actor, I'm now doing it from inside a node of my BT that I only run once.

Product Version: Not Selected
Tags:
more ▼

asked Jan 27 '15 at 08:54 PM in Blueprint Scripting

avatar image

Sprawl
40 6 7 9

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

2 answers: sort voted first

There is a node called 'GetControlledPawn' that will give you the current Pawn controlled by a Controller. If this node does not show up, try casting your AIController to Controller.

Since you say 'getControlledPawn' and 'getController' returns None, try using Posses function to manually posses the AI Pawn and try those nodes again. See if it works then.

more ▼

answered Jan 29 '15 at 02:42 AM

avatar image

mindfane
3.4k 154 52 272

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

Hi!

This may come a bit late, but I had the same question as you and I started to mess around with blueprint editor trying to figurate out a way to access to the actor blueprint being controlled by the AI controller. And finally I found a way: after you use "Get Controlled Pawn" node, you can use an action called "Get Instigator" (To be accurate it is in the following path: Variables > Actor > Get instigator ). And there you have this Pawn's Actor. Then you only have to cast it to according class and that's it.

I hope this can help you!

more ▼

answered Jan 02 '19 at 12:15 AM

avatar image

Acoraide
6 2

(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