Unreal Engine 4 Scripting with C++ Cookbook by William Sherif Stephen Whittle (Packt Publishing 2016)

Unreal Engine 4 Scripting with C++ Cookbook by William Sherif Stephen Whittle (Packt Publishing 2016)

Author:William Sherif, Stephen Whittle (Packt Publishing, 2016)
Language: eng
Format: epub, mobi
Publisher: Packt Publishing


In the .cpp file for DoorBell, #include "Openable.h".

Load a static mesh for our DoorBell in the constructor:HasBeenPushed = false; autoMeshAsset = ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Cube.Cube'")); if (MeshAsset.Object != nullptr) { GetStaticMeshComponent()->SetStaticMesh(MeshAsset.Object); //GetStaticMeshComponent()->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName); GetStaticMeshComponent()->bGenerateOverlapEvents = true; } GetStaticMeshComponent()->SetMobility(EComponentMobility::Movable); GetStaticMeshComponent()-> SetWorldScale3D(FVector(0.5, 0.5, 0.5)); SetActorEnableCollision(true); DoorToOpen = nullptr;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.