Example #1
0
//========================================================================
void APlatformActor::Init()
{
	auto* meshComp = GetStaticMeshComponent();
	meshComp->SetMobility(EComponentMobility::Movable);
	meshComp->SetStaticMesh(gHexEditor->AvailablePlatforms[0]);

	meshComp->OnClicked.AddDynamic(this, &APlatformActor::OnClick);
	meshComp->SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);

	AttachRootComponentToActor(gHexEditor);
}
Example #2
0
void ASkill::InitializeSkill(AGameCharacter* owner)
{
    if (Role < ROLE_Authority)
        return;

    SetOwner(owner);
    AttachRootComponentToActor(owner);

    characterOwner = owner;
    skillState = ESkillState::NotLearned;
}
void ACubiquityOctreeNode::initialiseOctreeNode(const Cubiquity::OctreeNode& newOctreeNode, UMaterialInterface* material)
{
	AttachRootComponentToActor(GetOwner());

	//UE_LOG(CubiquityLog, Log, TEXT("%d My absolute: %d %d %d     Parent absolute: %d %d %d     Relative: %d %d %d"), depth, nodeX, nodeY, nodeZ, parentX, parentY, parentZ, nodeX - parentX, nodeY - parentY, nodeZ - parentZ);
	
	structureLastSynced = 0;
	propertiesLastSynced = 0;
	meshLastSynced = 0;
	nodeAndChildrenLastSynced = 0;

	mesh->setVolumeType();

	mesh->SetMaterial(0, material);
}