Undeclared Idenitifier Problem



Grabber.cpp:

// Mario Choy

#include "DrawDebugHelpers.h"
#include "Engine/World.h"
#include "GameFramework/PlayerController.h"
#include "Grabber.h"

#define OUT

// Sets default values for this component's properties
UGrabber::UGrabber()
{
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
	// off to improve performance if you don't need them.
	PrimaryComponentTick.bCanEverTick = true;

	// ...
}


// Called when the game starts
void UGrabber::BeginPlay()
{
	Super::BeginPlay();

	UE_LOG(LogTemp, Warning, TEXT("Grabber reporting for duty!"));
}


// Called every frame
void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	FVector PlayerViewPointLocation;
	FRotator PlayerViewPointRotaton;

	GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(
		OUT PlayerViewPointLocation, 
		OUT PlayerViewPointRotation
		);

	// UE_LOG(LogTemp, Warning, TEXT("The player's location is: %s and it's rotation is %s"), 
	// 	*PlayerViewPointLocation.ToString(), 
	// 	*PlayerViewPointRotation.ToString()
	// 	);

	FVector LineTraceEnd = PlayerViewPointLocation + PlayerViewPointRotation.Vector() * Reach;

	DrawDebugLine(
		GetWorld(),
		PlayerViewPointLocation,
		LineTraceEnd,
		FColor(0, 255, 0),
		false,
		0.f,
		0,
		5.f
	);
}

So how do I fix this?

You have misspelt the variable and tried to use the correctly spelt rotation here

I already solved that before you wrote the post.

Yes, but I want to fix OpenDoor.

Would you mind sending me your project using the following link?

https://gdev.tv/projectupload

Please use File > Package Project > Zip Up Project within Unreal as this will ensure only required files are zipped up and things like the Binaries are excluded.

When I sended you my project do I unzip the project?

I’ve zipped up the project.

In the what is your name section do I use UnrealEngine or my real name?

I now submitted it!

I just set the door to be movable and it works on my end

image

Okay, let me try.

I feel like movable is dangerous because then I can knock the door out, no I can’t because I’m too light. What about I use stationary?

Is there a different way?

I can’t get through the door! I think it’s too small. Maybe, it’s because the default
pawn is too big. Can you tell me why I can’t fit?

That would be independent of being movable. What you are referring to would happen only with physics simulation but the door isn’t simulating physics. Moveable/Stationary/Static are really about lighting and shadows.

If a mesh is going to be moved in any way then that would mean the lighting/shadows need to be dynamic. If it’s never going to move then the shadows can be prebuilt and be static i.e. not dynamic.

So if it’s going to move by any means it needs to be movable.


You can’t fit through the door because you have collision on the door frame. Simply remove it

I don’t know how to get the door frame tab. How?

I have a problem, when I play I can go through the door without it opening. I have sended you my game.

When I was playing my BuildingEscape game, when I got to the edge, I fell down. I didn’t want it to happen and I wanted to fix it.
When I went into the Bull Cows project today I saw a thing called BlockingVolume. I have played the game, and I can see that it blocks the player. What is a blocking volume? Is it useful? How do I place a blocking volume?
A BlockingVolume is exactly what I want. I don’t want to fall of the edges of the BuildingEscape game. Is there another object in Unreal Engine 4 that blocks a player in a manner that is similar to my current situation?
I am also about to finish the BuildingEscape game(as I am on lecture 129 of the Unreal C++ Developer: Learn C++ and Make Video Games course) so you might as well not be that slow.

I am stuck, I can’t create a new level? How do I do that?

You have no collision on the door. Open it in the static mesh editor and use the collision menu too add a box collision.

Other than having a static mesh instead, no.

Privacy & Terms