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"

How to call AI Controller function from Player Controller

Right now I am using a Player Controller with my character to take in right-clicks for movement like a top-down game. After right-clicking on a certain spot, I need to use a Player Controller to get the Hit Result from "Get Hit Result Under Cursor By Channel." However, I am then trying to call "Move To Location or Actor" which requires an AI Controller. I used Simple Move to Location at first, but I was unable to access things like Acceptance Radius, pathfinding, and On Move Finished that "Move To Location or Actor" has.

I currently have my character's "Auto Possess Player" disabled and set AI Controller Class to my AI Controller. I read in the hierarchy here: http://blog.meltinglogic.com/2015/04/unreal-rts-rpg-movement-behaviors/ that the Player Controller should only take in inputs and only have the AI Controller hooked up to the player, and that's what it seems like I have. Yet when my Player Controller calls Get Player Character(0) --> Get AIController --> Move To Location or Actor, there is no movement. And my print statements show that it gets the Player Character fine, but fails at the Get AIController step.

I am new to Unreal and have already spent countless hours just trying to get movement working. Any help would be appreciated.

Product Version: UE 4.21
Tags:
more ▼

asked Dec 09 '18 at 10:34 AM in Using UE4

avatar image

US Economy
1 1 1

avatar image US Economy Dec 09 '18 at 01:39 PM

I included this in my AI Controller as well, but it doesn't print anything out. https://gyazo.com/e006e473e8e567429a0e32b7769dfd18

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

0 answers: sort voted first
Be the first one to answer this question
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