No announcement yet.

Changing controller of pawn

  • Filter
  • Time
  • Show
Clear All
new posts

    Changing controller of pawn

    My ai controller works fine when it is default. I have tried using function set ai controller class to change it from default , but it did not effect anything.
    Click image for larger version

Name:	1.jpg
Views:	1
Size:	367.8 KB
ID:	1160826
    Click image for larger version

Name:	2.jpg
Views:	1
Size:	316.4 KB
ID:	1160827


    you are changing the CLASS and you are trying to get an OBJECT of that Class.
    One CLASS can be spawned SEVERAL times. Your Blueprints for example are also Classes.
    And if you spawn one in your Scene, it will become one of multiple objects of that Class.

    If you want to change the AI Controller class which is spawned and used, you need to open
    your AI Pawn and set it in the "Class Defaults" Settings.

    Also "Get AI Controller" will always return the "AIController" type as reference. If you've changed the
    class in the DefaultSettings to your own class (which should be Child of AIController), you should
    be able to cast the Return Value to your specific Controller class.
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)


      Sorry, but i did not say the controller should be chengeable in game between ai and possessed with usual controller. Is there anyway to do that?