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 do I interface between my PlayerController BP and my Pawn BP?

I have my player controller BP taking in input, and I have a blueprint based on a Ship class, which inherits from Pawn. I want to receive that controller input and use it to move my pawn either inside its C++ class or its BP. How do I connect the two? I don't want to embed controls into my pawn BP... that seems so hard-coded and not modular.

Any ideas?

Product Version: Not Selected
Tags:
more ▼

asked Jun 24 '14 at 02:51 AM in Blueprint Scripting

avatar image

HateDread
453 41 47 72

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

2 answers: sort voted first

If PlayerController possesses Pawn, they keep references to eachother:

  • You can get Pawn from PlayerController using "Get Controlled Pawn"

  • You can get PlayerController from Pawn using "Get Controller"

more ▼

answered Jun 24 '14 at 11:09 AM

avatar image

Shadowriver
37.2k 936 172 1116

avatar image HateDread Oct 14 '14 at 11:55 AM

This was so long ago - sorry for never marking this as the answer! Ended up using blueprint interfaces ever since.

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

use the node in your blueprint set default controller.

more ▼

answered Jun 24 '14 at 03:56 AM

avatar image

DJMidKnight
1.2k 50 24 51

avatar image HateDread Jun 24 '14 at 04:27 AM

I don't see that in either my ship (pawn)'s BP or my controller. Where exactly should I find it?

avatar image DJMidKnight Jun 24 '14 at 05:29 AM

ok setup should be (which you have to add to your event graph) EVENT BEGIN PLAY -> SPAWN DEFAULT CONTROLLER

avatar image HateDread Jun 24 '14 at 05:49 AM

Okay, I can find that. What does this do regarding the interfacing between my custom controller and my pawn BP? What is this 'default controller' and what does it do?

avatar image DJMidKnight Jun 24 '14 at 05:59 AM

Ok lets see is this separate from the normal controller class as in addition to?

if not you can set your player controller in the Game Mode if you have a custom one or check whats being used in the World Settings under Game Mode/Player Controller. Maybe this will help if you haven't read it already. Controller

avatar image HateDread Jun 24 '14 at 11:01 AM

It's just a blueprint of the normal playercontroller.

I have it set as my default controller for the mode, yeah.

The question I'm asking now, I guess, is if the Pawn BP is meant to have the Axis events and what-not, or if they should exist only in the controller and then somehow get passed on to the pawn. That seems more decoupled to me, which is the ideal solution.

(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