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"

Is it possible to change the shape of the DefaultPawn CharacterController?

The collision component for the DefaultPawn class is a sphere, but I wanted to know if it was be possible to change it to something else such as a box or a capsule, or even a mesh.

Thanks, Ben

Product Version: Not Selected
Tags:
more ▼

asked Aug 11 '14 at 04:56 PM in Using UE4

avatar image

zerofiftyone
204 26 28 93

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

2 answers: sort voted first

You can't remove the native sphere component, but you could subclass it using a Blueprint and add a new collision component based on whatever shape you like. Just make the old CollisionComponent "NoCollision" to turn it off.

more ▼

answered Aug 11 '14 at 05:02 PM

avatar image

cgrebeld
497 25 16 33

avatar image zerofiftyone Aug 11 '14 at 10:06 PM

Could you explain how subclassing works and how it's done?

I've tried replacing the collision component with a box collider and giving it identical settings to the original sphere collider, but it doesn't seem to work.

Thanks for your time

avatar image cgrebeld Aug 12 '14 at 01:44 PM

You can create a new blueprint and choose DefaultPawn as the base class (AKA subclass DefaultPawn).

Then in your component view you can disable the sphere component collision and add your box component.

You can turn on Collision preview in your viewport to double check that the box is activated (Alt+C)

By the way if you want good tutorials on Blueprints, just check out the Unreal Engine youtube videos.

avatar image zerofiftyone Aug 12 '14 at 03:10 PM

Hmm.. I think I've followed all of the steps, but the pawn is still not colliding. Is it something to do with the way the components are parented? I'm not able to change the parent of the MeshComponent, nor am I able to make the box collider the root.

alt text

avatar image cgrebeld Aug 12 '14 at 04:02 PM

I see what you mean - I can't get it to work with a Blueprint either. Sorry!

In that case, if you really want to use DefaultPawn the best option might be to make a copy of DefaultPawn.cpp / .h and change the constructor so that it uses the shape you want. (It's hardcoded to use a USphereComponent ).

avatar image zerofiftyone Aug 13 '14 at 04:04 AM

Hmm. I gave it a try, but I'm almost certain I'm going about the process incorrectly since I'm getting compiler errors all over the place :P

I'm not opposed to ditching DefaultPawn aside from the fact that I need the FloatingPawnMovement component, and I read that DefaultPawn was the only class to use for that.

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

It looks like you are trying to make a vehicle, why not try using the WheeledVehicle class? It has a mesh root component.

more ▼

answered Aug 13 '14 at 03:48 PM

avatar image

cgrebeld
497 25 16 33

avatar image zerofiftyone Aug 13 '14 at 08:06 PM

I've investigated it as an alternative, but the WheeledVehicle class needs a Skeletal mesh as opposed to a Static mesh, and it also lacks the FloatingPawnMovement component which makes it unsuitable unfortunately.

(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