Just switched from Unity to Unreal - Completely lost with C++ and so confused

Let me start out by saying I am well experienced with C# in Unity, in case anyone thinks I should use blueprints. To be completely honest, I don’t like blueprints. That is, using it for everything. But I want to start out simple and there are no C++ tutorials. Am I the only one in the world who prefers C++? No one has a decent tutorial that explains what things are doing, they all just type and type and don’t explain what each line of code is doing. Not only that, but with Unity it’s so much easier to get help. You just , “Unity player movement” but when I it for Unreal I get either blueprints or demonstrations of someone else’s character controller.

Can someone point me in the right direction to get started with Unreal C++?

We have a couple of documents to help people transitioning from Unity to UE4:

The links above explain the UE4 equivalent terms, classes, and functions for someone coming from Unity, and include both C++ and Blueprint examples.

You may also want to check out our general programming guide, as well as our introduction to C++ programming in UE4 guide, and C++ programming tutorials.

In terms of learning how to create more complex features, we have a number of example projects available (both in C++ and Blueprints) that demonstrate a variety of engine features.

Hopefully this helps you get started, but if you need help on a specific feature then please feel free to ask on AnswerHub or the Forums and someone will likely be able to help you further.

I understand you, because I started with Unity too (learning Java, actually), and the video tutorials there are very good, indeed.

I´m trying to learn C++ too, but there is no good videos for begginners, I mean really beginners…

The staff created this serie: null - YouTube

But as yuo said, it is a little hard to understand, too much typing, but try this one if you didn´t see it yet.

Hope the Staff can help us about that.

Using Blueprint to begin with is the best way to familiarize yourself with the API. You’ll learn Unreal and C++ in Unreal faster if you Blueprint for a while first, as opposed to jumping straight in.

Blueprint is designed to be used in conjunction with C++, so don’t write it off. See ShooterGame for example. Even the most hardcore C++ programmers usually prototype in Blueprint first.

You have a good point. Maybe I’ll open up a little more to blueprints, but the problem is no one uses C++ on youtube :frowning:

Wow this is great, thanks!!!

Hey sorry to bother you again, but I’m still confused on the whole syntax. How can I access my components such as my transform in C++?

Also I have this script:

// Fill out your copyright notice in the Description page of Project Settings.

#include "Test.h"
#include "PlayerControllerInput.h"

	PrimaryComponentTick.bCanEverTick = true;

void UPlayerControllerInput::BeginPlay()

void UPlayerControllerInput::Tick(float DeltaSeconds)

and this header:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "Components/InputComponent.h"
#include "PlayerControllerInput.generated.h"

class TEST_API UPlayerControllerInput :  UInputComponent
	virtual void BeginPlay() override;
	virtual void Tick(float DeltaSeconds) override;


yet it doesn’t recognize the function Tick.

It’s possibly not being used. Did you set a breakpoint at BeginPlay and confirm that this input component is being used at runtime?

You can always rebase a blueprint to C++ at a later date if you want to move some of it’s functionality into code later. I find Blueprints easiest for dealing with in level and in game assets. I find C++ much easier to debug than blueprints.

For some reason when I made a new file that was written completely the same, it started working. But I got this error saying it wouldnt be shown in the browser, and even though it is a uclass, it wont show up?

There are a couple possibilities for what is going on.

First though. What do you need to extend the InputComponent for?

What version of the Engine are you using?

You are using a constructor, which isn’t necessary, but, if it is used you need to use the FObjectInitializer. Here is a link to a thread discussing it: forum link

Here is the document on InputComponent:
Doc Link

I’m not sure that this tick is being called on this, you may need to extend FTickableGameObject, not sure since it’s a component. PlayerInput is what manages these and it looks to be purely event driven.
link text

Im sorry for the delayed reply.

I dont really know what is going on when I open the engine. I want to make everything from scratch, but Im so confused as to why I have a player moving around in my brand new project when I really haven’t done anything.

There is no starting from scratch. Even if you just used straight C++ with OpenGl or Direct X you would not be starting from scratch and a GameEngine is a lot more than just a graphics library.

Start with a blank project if you want next to no built in gameplay, such as just look around but no move.

At first I thought you wanted to extend the inputcomponent because you were adding an unsupported device. But, I don’t think you actually have need to extend that component, it does a binding between the hardware input and the controller. If you were extending it, it would be to make some sort of changes in how the binding worked. In my short look at it, it appears to have nothing to do with processing the input and acting upon it in a unique way.

Also, it is event driven and not necessarily going to be doing something every tick.

What I think you are looking for is to do is capture the input and then handle it yourself.

For that, you don’t need any custom input.

Get the HandleInput events in the controller and then act on them as you want.

Here is the documentation on setting up a character, if you scroll down you will see how it captures input events and then controls movement from them. If you want to move different, or do something else with the input you are free to.

Character Setup Link