Setting Custom Physics Volume to bColored causes it to disappear on map reload

#Code

Below is my custom physics volume class, it works great!

Unless I set bColored to true, then it disappears on map reload, even though it is still there.

If I dont set bColored to true, I can do many map reloads and is still there

but

sniff

its not pink anymore!

#.h

// Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "RamaVolume.generated.h"

/**
 * 
 */
UCLASS()
class ARamaVolume : public APhysicsVolume
{

}

#.cpp

ARamaVolume::ARamaVolume(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
  //Color!
  //bColored = true;
  //BrushColor = FColor(255,0,255,255); //Pink!!!
}

#Issue

If I uncomment the above, I get pretty vertex coloring when I first create the volume

but when I exit editor and reload map it disappears.

If I use scene outliner I can find it, but even after highlighting it, it does not appear again, the vertices show up, but not the lines.

#Repro

  • make a custom PhysicsVolume similar to my above class

  • uncomment my commented out code

  • compile

  • drag into world in editor from the volumes section

you will see it!

all will seem great!

  • save level

  • exit

  • reload editor

should be gone now

  • comment out my code again

  • reload editor, repeat

should be fine on map reload

buuuut

I want the pretty vertex coloring!

:slight_smile:

#Solution

Adding these lines fixed the bug

BrushComponent->BodyInstance.bEnableCollision_DEPRECATED = false;
BrushComponent->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);

still seems worth addressing 2 me

as custom volumes are an awesome feature!

#Deprecated
and since that thing is DEPRECATED it should not cause an error of any kind!

Hi . I tried to replicate the issue that you described, but I was unable to get the volume to disappear after applying the custom color code. I created a class using the sample code you provided, with one exception. I was unable to compile the class without including the line “GENERATED_UCLASS_BODY()” in the .h file. Can you confirm whether or not you have that line included in your .h?

Thanks.

I did have that line yes, my above code was just pseudo code.

Hmmm.

Well, I will leave this thread here so others can find the solution if they ever encounter it, but it’s not a huge deal :slight_smile: