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. 

Custom pawn class (from scratch)?

I've followed all of the tutorials, become familiar with the BP system (and even a lot of the UE4 API via C++). But I can't for the life of me figure out how to create a simple pawn class from scratch, with nothing more than an orbit camera. The character blueprint class has way too much overhead (and unnecessary physics, by default), so I started by subclassing the pawn class. Then I added a Spring Arm component and Camera actor, then parented the Camera to the Spring Arm. I've set up all my input mappings under project settings, and basically copy/pasted the "Add Controller X Input" stuff from the 3rd person starter project. I have set my game mode to use this pawn by default.

When I press play, the camera never moves. Why is this? What else am I missing? All I need is to have the camera look at a point in world space, and orbit around that point, but I can't seem to get basic camera movement working.

Product Version: UE 4.10
more ▼

asked Jan 23 '16 at 02:29 AM in Blueprint Scripting

avatar image

250 27 40 50

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

1 answer: sort voted first

Clean Pawn does not have any movement, you need to code it and if does not work then there problem between pawn and controller communication.

The free fly camera you have when default pawn is not set is also a pawn called ADefaultPawn, i think it the closest thing to what you want to make, so look up it's code:

https://github.com/EpicGames/UnrealEngine/blob/97c8d3ef55e869e17ef149903eae2a33101381c9/Engine/Source/Runtime/Engine/Private/DefaultPawn.cpp https://github.com/EpicGames/UnrealEngine/blob/97c8d3ef55e869e17ef149903eae2a33101381c9/Engine/Source/Runtime/Engine/Classes/GameFramework/DefaultPawn.h

more ▼

answered Jan 23 '16 at 02:42 AM

avatar image

36.6k 931 169 1111

avatar image MichaelWion Jan 23 '16 at 03:33 AM

Just looked through that code, and it doesn't appear to be any different from what I'm doing already (via blueprints). I've just omitted all of the actual movement code ( MoveRight, MoveForward ) since the camera should only rotate around a pivot point. Perhaps the answer is actually in UPawnMovementComponent or UFloatingPawnMovement?

avatar image MichaelWion Jan 23 '16 at 03:43 AM

I actually just looked into those and it only seems to lead to no answers, and only more questions. Is there just no simple way to achieve this?

avatar image Shadowriver Jan 23 '16 at 04:08 AM

You can use UFloatingPawnMovement with MaxSpeed 0 i guess

avatar image MichaelWion Jan 23 '16 at 04:59 AM

No dice. Adding a FloatingPawnMovement component to my pawn blueprint still doesn't rotate/move anything, and setting MaxSpeed to 0 obviously has the same effect.

avatar image MichaelWion Jan 23 '16 at 05:01 AM

I'm guessing that the actual movement code is embedded deep within the UE4 source, and so the only way to create a custom orbit camera pawn would literally be to do all the math from scratch and set the world transform on each frame?

avatar image Shadowriver Jan 23 '16 at 05:42 AM

No, all modules are the same, what is engine code can be done in game code, the code you see to link i post you works, if you copy paste it should work,if it's not then problem is somewhere else. Doublecheck component set up, check if code is fully executed by placeing breakpoints in varius critical points. Chec kif actor is correcly spawned and possessed

avatar image MichaelWion Jan 23 '16 at 07:17 AM

I have opened up the Third Person Character startup project, and edited the character blueprint to my liking, tested it, and it works exactly how I'd like it to. I then saved, and copied the asset to my main project's blueprints folder, triple-checked as many settings as I could to make sure they are identical, then tested it in my project... It turns out, there's some sort of issue with getting the mouse axis to report any changes in my project. So I suppose this is the root of my problem, and I'll start a new question for this. Thanks!

avatar image MichaelWion Jan 23 '16 at 07:45 AM

Figured it out: alt text

(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