Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. //This time spawn location and rotation is ok. But the actor doesnt collide with the floor
  2.  
  3. ASomeThing::ASomeThing(const FObjectInitializer &ObjectInitializer) :Super(ObjectInitializer)
  4. {
  5.  
  6.     Mesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("PickupMesh"));
  7.    
  8.     static ConstructorHelpers::FObjectFinder<UStaticMesh> StaticMesh(TEXT("StaticMesh'/Game/ThirdPerson/Meshes/Ramp_StaticMesh'"));
  9.     static ConstructorHelpers::FObjectFinder<UMaterial> Material_Blue(TEXT("MaterialInstanceConstant'/Game/StarterContent/Materials/M_Water_Lake.M_Water_Lake'"));
  10.  
  11.     Mesh->SetSimulatePhysics(true);
  12.     Mesh->SetStaticMesh(StaticMesh.Object);
  13.     Mesh->SetMaterial(0, Material_Blue.Object);
  14.     Mesh->GetCollisionEnabled();
  15.     RootComponent = Mesh;
  16.  
  17.     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
  18.     PrimaryActorTick.bCanEverTick = true;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement