cannot idenitfy mistakes

Jun 26, 2018 at 6:27pm
Microsft visual studio says that from "Inputcomponent onward its been placed in wrong. I have reviewed what the online instructor has done and I cannot seem to fix it. Thanks for any help

[code]
Put the code you need help with here.
[// Called to bind functionality to input
void AHerocontroller::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);

InputComponent->BindAxis("MoveX", this, & AShipController::MoveHorizontally);
InputComponent->BindAxis("MoveY", this, & AShipContolller)::MoveVertically);
}

void AHeroController::MoveHorizonatly(float AxisValue)
{
CurrentVelocity.X = FMath::Clamp(AxisValue), -1.0f, 1.0f * 100.0f;
}
void AHeroController::MoveVertically(float Axisvalue)
{
CurrentVelocity.Y = Fmath::Clamp(AxisValue, -1.0f, 1.0f) * 100.0f;
}code]
Jun 26, 2018 at 6:47pm
I have no idea what code this is but... look here, they don't match.

CurrentVelocity.X = FMath::Clamp(AxisValue), -1.0f, 1.0f * 100.0f;

CurrentVelocity.Y = Fmath::Clamp(AxisValue, -1.0f, 1.0f) * 100.0f;

So which is correct?
Jun 26, 2018 at 7:06pm
thanks thats one error fixed another fifty to go lol its code for movement for a simple game as I am trying to learn C++

Jun 26, 2018 at 7:19pm
closed account (E0p9LyTq)
I have no idea what code this is

Unreal Engine.
http://api.unrealengine.com/INT/API/Runtime/Core/Math/FMath/Clamp/index.html
Jun 26, 2018 at 7:58pm
Unreal!! Cool, I would like to learn that one day.
Jun 26, 2018 at 10:06pm
closed account (E0p9LyTq)
Trying to learn C++ by using a commercial game engine?

That is like eating a 2000 pound cow in one bite.

If you are truly attempting to learn C++ with no prior experience you should start with something much simpler. Online tutorials of the basics of C++ would be a good start:
http://www.cplusplus.com/doc/tutorial/
http://www.learncpp.com/
Topic archived. No new replies allowed.