캐릭터가 움직이지 않아요

void AShooterCharacter::SetupPlayerInputComponent(UInputComponent *PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);

	PlayerInputComponent->BindAxis(TEXT("MoveForward"), this, &AShooterCharacter::MoveForward);
	PlayerInputComponent->BindAxis(TEXT("LookUp"), this, &APawn::AddControllerPitchInput);
	PlayerInputComponent->BindAxis(TEXT("MoveRight"), this, &AShooterCharacter::MoveRight);
	PlayerInputComponent->BindAxis(TEXT("LookRight"), this, &APawn::AddControllerYawInput);
	PlayerInputComponent->BindAction(TEXT("Jump"), EInputEvent::IE_Pressed, this, &ACharacter::Jump);
}

void AShooterCharacter::MoveForward(float AxisValue)
{
	UE_LOG(LogTemp, Error, TEXT("Your message"));
	AddMovementInput(GetActorForwardVector() * AxisValue);
}

void AShooterCharacter::MoveRight(float AxisValue)
{
	AddMovementInput(GetActorRightVector() * AxisValue);
}

스크린샷 2024-08-01 224919

I set it up like this. But the log doesn’t even print out. I don’t think the function is applied.

And suddenly, the graphics driver version didn’t fit and Unreal didn’t turn on, so I updated the graphics driver,

LogRHI: Error: GpuProfiler’s scratch buffer is out of space for this frame (current size : 32 kB). Dropping this frame. The size can be increased dynamically with the console variable r.GpuProfilerMaxEventBufferSizeKB

These are the words that come out. I wonder if the above words are also the cause…

The error disappeared when I typed the command below in the Unreal console window.

r.GpuProfilerMaxEventBufferSizeKB 64

But now, when I open the editor again

table { border: 1px solid #c4c7c5; border-radius: 4px; font-size: 16px; } th { padding: 18px 16px; text-align: left; } td { padding: 16px; border-top: 1px solid #c4c7c5; } .katex-mathml{ display: block; text-align: center; } .katex-html { display: none; }

LogAnalytics: Warning: EventCache either took too long to flush (8.766 ms) or had a very large payload (8.495 KB, 14 events). Listing events in the payload for investigation: LogAnalytics: Warning: SessionStart,1470 LogAnalytics: Warning: SessionMachineStats,1457 LogAnalytics: Warning: Audio.Usage.ProjectSettings,162 LogAnalytics: Warning: Editor.ProgramStarted,111 LogAnalytics: Warning: Editor.Usage.Project,246 LogAnalytics: Warning: Editor.Usage.Modules,126 LogAnalytics: Warning: Editor.Performance.Startup,92 LogAnalytics: Warning: PythonScriptPlugin,84 LogAnalytics: Warning: Editor.Usage.AssetCounts,171 LogAnalytics: Warning: Editor.Usage.AssetClasses,3776 LogAnalytics: Warning: Editor.Performance.FrameRate,116 LogAnalytics: Warning: Editor.Usage.BlueprintEditorSummary,438 LogAnalytics: Warning: Editor.Usage.BlueprintCreated,215 LogAnalytics: Warning: Editor.Usage.BlueprintCreated,222

This time, it comes up like this

I was wondering if the textural streaming pool went over the budget was the cause, so I went to Google and solved it.

But the character still doesn’t move right now.

This time,

LogAnalytics: Warning: EventCache either took too long to flush (15.971 ms) or had a very large payload (0.776 KB, 4 events). Listing events in the payload for investigation:
LogAnalytics: Warning: Editor.Usage.Heartbeat,436
LogAnalytics: Warning: Editor.Usage.PIE,98
LogAnalytics: Warning: Editor.Usage.PIE,86
LogAnalytics: Warning: Audio.Usage.ProjectSettings,162

It comes up like this

LogD3D11RHI: Timed out while waiting for GPU to catch up. (0.5 s) (ErrorCode 00000001) (00000000)

This comes out, too

Are you getting log messages if you add one to MoveRight?

The log did not appear. But now it’s settled.

I need to listen to the lecture a little more, but the characters moved. I didn’t move with the code I left in the question.

// shooter.h
private:
	void LookUpRate(float AxisValue);
	void LookRightRate(float AxisValue);

	UPROPERTY(EditAnywhere)
	float RotationRate = 10.f;
shooter.cpp
void AShooterCharacter::SetupPlayerInputComponent(UInputComponent *PlayerInputComponent)
{
PlayerInputComponent->BindAxis(TEXT("LookUpRate"), this, &AShooterCharacter::LookUpRate);
PlayerInputComponent->BindAxis(TEXT("LookRightRate"), this, &AShooterCharacter::LookRightRate);
}
void AShooterCharacter::LookUpRate(float AxisValue)
{
	AddControllerPitchInput(AxisValue * RotationRate * GetWorld()->GetDeltaSeconds());
}

void AShooterCharacter::LookRightRate(float AxisValue)
{
	AddControllerYawInput(AxisValue * RotationRate * GetWorld()->GetDeltaSeconds());
}

The code above is the code I added after watching the lecture. Why didn’t it move before I wrote this code? I think this happened in the past.

None of that code should affect moving so it’s rather likely you just needed to rebuild.

Why did I have to enter that code to move when it didn’t affect my movement…?
Was it simply a coincidence? It’s hard.

Any change and then building would have done it.

When you build, only modified files will be built and will re-use previously compiled files otherwise. Editing the file and saving it before building would mean the build system would see it has a new last modified timestamp since the last build and go ahead and recompile it.

It’s very likely that it didn’t build correctly the first time.

I don’t understand what you mean… :sweet_smile:
I already built it before adding that code, and there must have been a reason.

Thank you anyway.

I’m saying, for whatever reason, there was a problem with that compilation. When you added more code the build system marked it as a file that needed to be recompiled.

Aha, I understand now.

Privacy & Terms