Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter

Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter

The Weapon - 2

Hide Widget Item을 쳐다보지 않거나, 일정거리 이상 멀어지면 위젯을 비활성화 하도록 하겠습니다. 마지막으로 쳐다본 아이템의 정보를 저장할 TraceHitItemLastFrame을 만들겠습니다. ShooterCharacter.h // The AItem we hit last frame UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Items, meta = (AllowPrivatieAccess = true)) class AItem *TraceHitItemLastFrame; 기존의 TraceForItems()에 TraceHitItemLastFrame을 설정하고, nullptr이 아니고, 현재 쳐다보는 대상이 아니라면 보이지 않게 설정합니다. S..

Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter

The Weapon - 2

PickupWidget Blueprint 무기를 주울 때 사용할 Widget을 만들 것입니다. Item이 이를 가질 수 있게 UWidgetComponent 포인터 변수를 생성해 줍니다. Item.h // Popup widget for when the player looks at the item UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Item Properties", meta = (AllowPrivateAccess)) class UWidgetComponent* PickupWidget; UMG를 다루기 위해서 Shooter.Build.cs 파일을 찾아 PublicDependencyModuleNames.AddRange에 "UMG"를 추가해 줍니다...

Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter

The Weapon - 1

The Item Class Actor를 상속받는 Item 클래스를 만들어 줍니다. 이는 웨폰의 부모가 될 것입니다. Item.h private: // Line trace collides with bos to show HUD widgets UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item Properties", meta = (AllowPrivateAccess)) class UBoxComponent *CollisionBox; // Skeletal Mesh for the item UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Item Properties", meta = (AllowPrivateAc..

Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter

Aiming and Crosshairs - 3

Automatic Fire 연사를 구현할것입니다. ShooterCharacter.h pubilc: void FireButtonPressed(); void FireButtonReleased(); private: // Left mouse button or right console trigger pressed bool bFireButtonPressed; // True when we can fire. False when waiting for the timer bool bShouldFire; // Fate of Automatic gun fire float AutomaticFireRate; FTimerHandle AutoFireTimer; void AShooterCharacter::FireButtonPressed(..

메카인
'Unreal 공부/Unreal Engine 4 C++ The Ultimate Shooter' 카테고리의 글 목록