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"

AddCollisionConvexMesh Crashes on android device

Hello:

I'm working on android game, using ASUS Zenfone3 as my device.

I have an array of FVector, which is going to add to a procedural mesh as a collision box .

Everything works fine when playing in editor. But it crashed when I played on my device.

I found out the problem is at AddCollisionConvexMesh. It won't crash if I delete this line, but the procedural mesh must have collision mesh so this line can't be deleted.

Why it works fine in Editor but not on device?

 void CreateCollisionBox(float MaxUpLength, float MaxRightLength, float MaxForwardLength) {
     // Clear any existing collision hulls
     ProcMeshComponent->ClearCollisionConvexMeshes();
 
     // Create collision box
     TArray<FVector> SimpleCollisionBox;
     for (int i = 0; i < 2; i++) {
         for (int j = -1; j < 2; j += 2) {
             for (int k = -1; k < 2; k += 2) {
                 SimpleCollisionBox.Add(
                     ProcMeshComponent->GetUpVector() * MaxUpLength * i +
                     ProcMeshComponent->GetRightVector() * MaxRightLength * j +
                     ProcMeshComponent->GetForwardVector() * MaxForwardLength * k);
             }
         }
     }
     ProcMeshComponent->bUseComplexAsSimpleCollision = false;
 
 
     //Crashes on device
     ProcMeshComponent->AddCollisionConvexMesh(SimpleCollisionBox);
 
     ProcMeshComponent->SetSimulatePhysics(true);
     ProcMeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
 }
Product Version: UE 4.17
Tags:
more ▼

asked Sep 20 '17 at 08:47 AM in C++ Programming

avatar image

deen_shiu
1 3 1 5

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

1 answer: sort voted first

I went to Project Settings -> Platforms -> Android -> Build, check "Support arm64".

AddCollisionConvexMesh works properly!

more ▼

answered Sep 20 '17 at 09:57 AM

avatar image

deen_shiu
1 3 1 5

(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