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"

Character can't move when stood on certain meshes.

I have a mesh with a custom box collision that works as expected. The character can bump into and walk on it when I place it in the level manually. I don't do anything to the collision just let it be the stuff I set up in the mesh. All is fine.

However when I spawn a mesh component in an actor at run time and set the mesh to be this mesh I cannot move while stood on the mesh. The character can still bump into it but if they are stood on it the can't do anything but jump. So I kinda have to leap frog across these spawned in meshes.

I know there will be some setting I'm forgetting about for spawning a static mesh component but I can't figure it out.

Here's my spawn code:

     for (int i = 0; i < NumPoints; i++)
     {
         Bridge.Add(NewObject<UStaticMeshComponent>());
         Bridge.Last()->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f));
         Bridge.Last()->SetWorldRotation(FRotator(0.f, FMath::Lerp(-180.f, 180.f, FMath::FRand()), 0.f));
         Bridge.Last()->SetupAttachment(Root);
         Bridge.Last()->SetStaticMesh(BridgeMesh[FMath::Rand() % BridgeMesh.Num()]);
         Bridge.Last()->RegisterComponentWithWorld(GetWorld());
 
         SpawnPoint = FMath::Lerp(LeftSide.GetLocation(), RightSide.GetLocation(), (float(i + 1) / float(NumPoints + 1)));
         Bridge.Last()->SetWorldLocation(SpawnPoint + ((FMath::VRand() * MaxRandDistance) * FVector(1.f, 0.f, 1.f)));
     }

I have tried placing the mesh scaled in level and It works as I need it to so its not a scale issue. I have toggled the collision visiblity so I can see that it is the same box as a placed mesh when I spawn it in. The mesh collision profile is left on BlockAllDynamic.

If you need any more info please ask.

Product Version: UE 4.22
Tags:
more ▼

asked May 15 '19 at 10:29 AM in C++ Programming

avatar image

HarryHighDef
1.4k 1 14 17

avatar image HarryHighDef May 16 '19 at 08:14 AM

Bump

avatar image HarryHighDef May 17 '19 at 08:18 AM

Bump

avatar image Lardo Deepdelver May 17 '19 at 11:56 AM

in the collision settings for the component, is CanCharacterStepUpOn enabled?

avatar image HarryHighDef May 17 '19 at 12:27 PM

Yep. Tried it with that both enabled and disabled and saw no difference.

avatar image HarryHighDef May 17 '19 at 12:28 PM

Managed to workaround by spawning static mesh actors instead. Still looking for a solution to have it as mesh components.

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

0 answers: sort voted first
Be the first one to answer this question
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