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. 

Crash C++ Project on build for Android,FObjectFObjectInitializer Problem

 AInfectedCharacter::AInfectedCharacter(const FObjectInitializer & ObjectInitializer)
     :Super(ObjectInitializer)
 {
     // Set size for collision capsule
     GetCapsuleComponent()->InitCapsuleSize(30.f, 80.0f);
     // set our turn rates for input
     BaseTurnRate = 45.f;
     BaseLookUpRate = 45.f;
     // Configure character movement
     GetCharacterMovement()->bOrientRotationToMovement = true; // Character moves in the direction of input...    
     GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate
     GetCharacterMovement()->JumpZVelocity = 600.f;
     GetCharacterMovement()->AirControl = 0.2f;
     GetCharacterMovement()->MaxWalkSpeed = 100.f;
     AttackStarted = false;
     bUseControllerRotationPitch = false;
     bUseControllerRotationYaw = false;
     bUseControllerRotationRoll = false;
     // Camera Setup
     CameraBoom = ObjectInitializer.CreateDefaultSubobject<USpringArmComponent>(this,"CameraBoom");
     CameraBoom->AttachTo(RootComponent);
     CameraBoom->TargetArmLength = 300.0f; // The camera follows at this distance behind the character    
     CameraBoom->bUsePawnControlRotation = true; // Rotate the arm based on the controller
     FollowCamera = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this,"FollowCamera");
     FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation
     FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm
     /** Mesh & AnimBP Install**/
     static ConstructorHelpers::FObjectFinder<USkeletalMesh> MeshContainer(TEXT("/Game/Meshes/SkeletalMesh/Juliet/MeshData/JulietMesh.JulietMesh"));
     if (MeshContainer.Succeeded())
     {
         GetMesh()->SetSkeletalMesh(MeshContainer.Object);
         GetMesh()->AddRelativeRotation(FRotator(0, -90.f, 0));
         GetMesh()->AddRelativeLocation(FVector(0, 0, -84.f));
         GetMesh()->CastShadow = true;
     }
     static ConstructorHelpers::FObjectFinder<UBlueprint> AnimBlueprint(TEXT("/Game/Meshes/SkeletalMesh/Juliet/AnimationData/JulietAnimBP.JulietAnimBP"));
     GetMesh()->SetAnimInstanceClass(AnimBlueprint.Object->GeneratedClass);
 }
 

alt text

Product Version: UE 4.10
Tags:
more ▼

asked Mar 17 '16 at 08:26 AM in C++ Programming

avatar image

AlexTH
1

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

1 answer: sort voted first

Assuming it is working in editor the most hazardous line is 37-th.
As I admit you are checking MeshContainer for validity before work, but forgot about AnimBlueprint. There is a little ambiguity with Android (as I can see from log it's an Android app) that object finders can not work sometimes. I don't know why and when, but it is happening.
Solution to avoid this is possibly very simple, but you are need to create blueprint derived from this character.
You can create TSubclassOf to declare class template as class variable.
What I mean is that you need to assign template variables through editor and use them in class constructor.
Like for skeletal mesh you need to declare in your character class field:

 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "character category")  
 TSubclassOf<USkeletalMesh> MeshTemplate;  

Create this mesh and assign to character's mesh.
Same for AnimBlueprint, and it's not recommended to use pure blueprint class, better to at least derive it from something and get it as type it's really appears to be. E.g. if we created actor blueprint, then we find this object supposing it's AActor, not UBlueprint.

И вопрос необходимо расписывать с максимумом известной информации, я, например, не понял в какой момент произошло падение. Судя по названию данного вапроса, я даже позореваю, что я зря на английском написал, но это так, для публики.

more ▼

answered Mar 17 '16 at 01:17 PM

avatar image

HungryDoodles
490 29 24 40

(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