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"

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. 

Change Skeletal Mesh based on Player selection

Rather simple task, but having trouble wrapping my head around it: I want the player to be able to select the the vehicle they want before a race. the idea so far is to: - save the selection to their gameinstance, - load the level - change the skeletal mesh and animation of the pawn once the level loads. my problem is this:

AFESPawn::AFESPawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { // Car mesh static ConstructorHelpers::FObjectFinder CarMesh(TEXT("/Game/Vehicle/Sedan/Sedan_SkelMesh.Sedan_SkelMesh")); GetMesh()->SetSkeletalMesh(CarMesh.Object);

 static ConstructorHelpers::FClassFinder<UObject> AnimBPClass(TEXT("/Game/Vehicle/Sedan/Sedan_AnimBP"));
 GetMesh()->SetAnimInstanceClass(AnimBPClass.Class);

(Pulled from the Vehicle C++ starter project pawn code)

When it does the FClassFinder and then loads the mesh from a string, how would i go about generating that string at run time? My first guess is to make a enum to represent all possible vehicles, then load the respective string paths of all possible vehicles and pass that in...

Note: I trying to make a multiplayer project, so if this would break a networked game, maybe you could point me in the right direction?

Product Version: UE 4.7
Tags:
more ▼

asked Jul 11 '15 at 01:00 PM in C++ Programming

avatar image

zlz_showtime
41 2 3 5

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

1 answer: sort voted first

Hey zlz_showtime,

I'd create a base class vehicle pawn and base blueprint vehicle pawns upon it trying to get as much done in c++ as possible. In the base class you might want to have things like the vehicle name etc.

In the GameMode class I'd add a function for registering a new vehicle. On game start (you probably wanna start out in a menu, otherwise it won't be doable or you have some default configured anywhere) you configure in the blueprint of each vehicle to register itself. you can also put that in the parent class but remember to call the registration of the superclass in the derived BP's. Then you place all those vehicle pawns in the menu and let the player choose. When transitioning to the GameMode where the player actually plays you just initialize that game mode with that parameter.

I hope that helps or at least gives you some ideas.

Regards

Lukas Wagner

more ▼

answered Jul 11 '15 at 02:51 PM

avatar image

m3t4lukas
18 1 3 6

(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