언리얼 엔진/C++

언리얼 엔진/C++

언리얼엔진 C++ AnimInstance

BP .CPP Pawn 이랑 Main 을 받아온다.

언리얼 엔진/C++

FTimerHandle

.h // 핸들을 가지고 있어야 다음에 종료를 할 수 있다. FTimerHandle AttackTimer; .cpp // GetWorldTimerManager().SetTimer(AttackTimer, this, &AEnemy::Attack, AttackTime, true); GetWorldTimerManager().ClearTimer(AttackTimer); 첫 번째 매개변수는 지금 생성되는 타이머의 핸들이다. 위에서 설명했듯이 이 핸들을 가지고 있어야 나중에 타이머를 종료할 수 있다. 두 번째 매개변수는 타이머 함수를 호출하는 오브젝트이다. 세 번째 매개변수는 타이머가 발동할 때마다 호출될 함수이다. 네 번째 매개변수는 타이머가 호출될 시간이다. 만약 값을 1로 두면 1초에 한 번씩 함수가 호출된다...

언리얼 엔진/C++

AI 따라오게 하기

.h UFUNCTION(BlueprintCallable) void MoveToTarget(class AProject_AACharacter* Target); UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "AI") class AAIController* AIController; .cpp void AEnemy::BeginPlay() { Super::BeginPlay(); AIController = Cast(GetController()); } void AEnemy::MoveToTarget(class AProject_AACharacter* Target) { if (AIController) { FAIMoveRequest MoveRequest; MoveReque..

언리얼 엔진/C++

소켓에 컴포넌트 붙이기

FName WeaponSocket(TEXT("Sword_joint")); CombatCapsule = CreateDefaultSubobject(TEXT("CombatSphere")); CombatCapsule->SetupAttachment(GetMesh(), WeaponSocket);

언리얼 엔진/C++

캐릭터 이동

MoveForward(float Value) // 앞, 뒤 FVector Direction = FRotationMatrix(Controller->GetControlRotation()).GetScaledAxis(EAxis::X); AddMovementInput(Direction,Value); MoveRight(float Value) // 오른쪽, 왼쪽 FVector Direction = FRotationMatrix(Controller->GetControlRotation()).GetScaledAxis(EAxis::Y); AddMovementInput(Direction, Value);

언리얼 엔진/C++

Unreal Engine 4 OnOverlap

.h UFUNCTION() virtual void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); UFUNCTION() virtual void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex); .cpp ->OnComponentBeginOverlap.AddD..

mane
'언리얼 엔진/C++' 카테고리의 글 목록 (7 Page)