UE5 C++ Enhanced Input - 3 - Float Value Types and Negate Modifiers

  Рет қаралды 27,352

Druid Mechanics

Druid Mechanics

Күн бұрын

Пікірлер: 64
@anonymletsplay4293
@anonymletsplay4293 3 ай бұрын
I am using the UE5.4 version, and my Pawn wasn't moving. Through debugging, I found out that both my Move() method and the Pawn were correctly configured. However, I had to add the movement component via C++ code. For all that have the same problem add: Header File "class UPawnMovementComponent;" and " UPROPERTY(VisibleAnywhere) UPawnMovementComponent* MovementComponent; CPP File: #include "GameFramework/FloatingPawnMovement.h" and in the contructor add "MovementComponent = CreateDefaultSubobject(TEXT("MovementComponent"));"
@rishikeshjaiswal3979
@rishikeshjaiswal3979 3 ай бұрын
Thanks bud! What was the process of solving this issue? You can also directly add the movement component from the blueprint itself.
@ImVid420
@ImVid420 2 ай бұрын
I did the same thing but it still didn't work for me. I am trying the Manny to use it as a Pawn.
@d3aresthelpless
@d3aresthelpless Ай бұрын
Thank you friendo, started to debug but checked comments to see if anyone had same issue on 5.4; well done!
@sy_chev
@sy_chev Ай бұрын
bro you just saved my stupid ass
@RudyOFH
@RudyOFH 29 күн бұрын
You are a God ;)
@RetroSteve0
@RetroSteve0 Ай бұрын
I was moving forward when I pressed `S` despite having a negate modifier set. Turns out, I forgot to change `Value.Get()` to `Value.Get()`, so if you run into that issue, that's likely it. ;)
@Markandei
@Markandei Жыл бұрын
Awesome video, thank you. Please don't stop making them - they are invaluable.
@pohuligan5998
@pohuligan5998 Жыл бұрын
Thank you for the updates! Came here from your awesome Udemy C++ Unreal Engine course (signed up for the C++ multiplayer course too, ofc!)
@foxwoosh
@foxwoosh 3 ай бұрын
Great tutorial as always, Stephen. I'm going through your Udemy multiplayer shooter course and wanted to have everything up to date in my project so I went through these videos. Everything works great except one thing. I hold W - I move forward. I hold S - I move backwards. However if I hold both W and S - I still move backwards because value is always -1 in this case for some reason. Im pretty sure it should be possible to set action to pass 0 if player holds both buttons with a modifier, but I don't really know how.
@Mittzys
@Mittzys 7 ай бұрын
If you want to skip the recap, go to 10:03
@gamerware
@gamerware Жыл бұрын
When you reopen the project and if EnhancedInput doesn't work on pawn , Remember to set the Auto Possess Player to Player 0 for that pawn which will make it a default pawn for the project ! , Thank you
@pohuligan5998
@pohuligan5998 Жыл бұрын
For some reason, my bird won't move. I've debugged it to the point the I know that code inside of ABird::Move is fired (UE_LOG shows values 1 to -1), but the actual bird is not moving. Please, advice
@illegalskillsexception9826
@illegalskillsexception9826 Жыл бұрын
I encountered this problem when I used Hot Reload instead of closing the editor and compiling from VS.
@zulfaezazizul8232
@zulfaezazizul8232 Жыл бұрын
Had the same problem. My fix was that when we're using AddMovementInput(), it doesnt add the movement component by default, so I needed to add the component first. In the tooltip it says that Base Pawn classes wont auto apply it. If you're subscribe to the course, check out lecture #68. Hope this helps!
@woytecki
@woytecki Жыл бұрын
@@zulfaezazizul8232 thanks, that helped
@7mm9mm
@7mm9mm Жыл бұрын
@@zulfaezazizul8232 Thanks, worked for me as well
@ChristopherFranko
@ChristopherFranko Жыл бұрын
In order to get your Pawn to move, you have to open your pawn in the blueprint editor, In the components tab select "add" and add the FloatingPawnMovement component. The reason you have to do this is, pawns dont implicitly have this component, I believe characters do but not pawns. Either way, once you add the movement component youll be able to move! Happy flying!
@tanaygupta958
@tanaygupta958 Ай бұрын
If your pawn is not moving, try the following steps: Check Input Detection: Close the editor and compile the code. Open the editor again and start playing the game. In the output log, enter the command "showdebug enhancedinput". This will display whether your inputs are being registered or not. Verify Component Addition: If your inputs are being detected but the pawn is still not moving, ensure that you have added the FloatingPawnMovement component to the BP_Bird blueprint. Once added, try playing the game again. Hot Reload the Project: If the pawn is still not moving after the previous steps, try hot reloading the project and then playing the game again. For some reason, this step resolved the issue for me. I'm unsure why the third step (hot reloading the project) solved the problem (despite successfully compiling earlier). If anyone has an explanation for this, please share it. Thanks
@ДеянЦонев-ы7в
@ДеянЦонев-ы7в 7 ай бұрын
Great tutorial. I have one question . Why there is a forward declaration of the UInputAction and there is the header file which contains its definition inside Bird.h ? Shouldn't the header file be included inside Bird.cpp when forward declaring?
@nazxuul
@nazxuul 11 ай бұрын
Good tutorial. I had trouble shutting down the Unreal editor and my pawn broke (components no longer working). Does this happen often? Should I just rebuild the pawn when this happens, or maybe keep a copy of it around just in case?
@TheHenebene
@TheHenebene 11 ай бұрын
I tried doing this in "Unreal Engine 5 C++ Developer: Learn C++ & Make Video Games" course "Toon Tanks" section. I dont have any error messages and and my code compiles succesfully but the tank doesent move. I get a ulog message when I press w and s. Any idea what could be the problem?
@TheHenebene
@TheHenebene 11 ай бұрын
Is there something in the "Toon Tanks " course that is interfering with the enhancedInputComponent or Im missing something?
@alertcriminal
@alertcriminal 7 ай бұрын
Im in the same boat, you figure it out?
@TheHenebene
@TheHenebene 7 ай бұрын
I added FloatingPawnMovement in BP_Tank components@@alertcriminal
@felbitse
@felbitse 6 ай бұрын
I guess it has to do with this comment in the documentation? > Base Pawn classes won't automatically apply movement, it's up to the user to do so in a Tick event. It am investigating this issue myself at the moment.
@felbitse
@felbitse 6 ай бұрын
To make this work, the Pawn needs a `FloatingMovementComponent`. You can attach that via Blueprint or C++ by adding UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Input) class UFloatingPawnMovement* PawnMovement; in Bird.h, and PawnMovement = CreateDefaultSubobject(TEXT("PawnMovement")); in Bird.cpp
@4relevants
@4relevants Жыл бұрын
I think I did everything ok, but I have an error: no matches with the argument list: EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ThisClass::Move);
@4relevants
@4relevants Жыл бұрын
Solved: I use a pointer instead of a reference in the Move function.
@0COVERSEALLSTAR0
@0COVERSEALLSTAR0 11 ай бұрын
I have a Problem in UE 5.3 - the BindAction doesn`t accept my function with &ABird::Move - so i have to cast it to FEnhancedInputActionHandlerSignature::TMethodPtr(&ABird::Move) - got this from rider, then my function is called but the value is always 0 - while when i log it with blueprint it is -1 or 1 - can this cast cause it?
@0COVERSEALLSTAR0
@0COVERSEALLSTAR0 11 ай бұрын
I found my issue - I forgot the const in Move for the FInputActionValue&
@hastycakes
@hastycakes Жыл бұрын
I got it working but my debug shows S two times, one saying OVERRIDDEN BY IMC_BirdContext:IA_Move. Any ideas why?
@dacdo2956
@dacdo2956 Жыл бұрын
Same here! @DruidMechanics Please help
@hastycakes
@hastycakes Жыл бұрын
@@dacdo2956 From what i’ve read and guess it has to do with setting the mapping context. I imagine if you eventually have to use an additional mapping context this isn’t really a problem
@dacdo2956
@dacdo2956 Жыл бұрын
@@hastycakes thank you, I just checked in the template, it has the same problem. Looks like it’s ok and we can live with
@hastycakes
@hastycakes Жыл бұрын
@@dacdo2956 No problem! If you’re taking the course he seems to reply regularly to questions so if you need help that’s a good place to go
@Shivyyy
@Shivyyy Жыл бұрын
In my input action IA_Move even if I set value type to a bool and then try to get a float value in move function it still works any idea why?
@L0v0lup
@L0v0lup 7 ай бұрын
Hi, how did you get the useful inline parameter infos/hints? I want them too xD
@L0v0lup
@L0v0lup 7 ай бұрын
Found it! Alt + F1
@karasuZanu
@karasuZanu Жыл бұрын
How can i add "FloatingPawnMovement" from c++ ? Thank you.
@ArthurPiroshkoff
@ArthurPiroshkoff Жыл бұрын
In Bird.h: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input) UFloatingPawnMovement* FloatingPawnMovement; In constructor in Bird.cpp: FloatingPawnMovement = CreateDefaultSubobject("Floating Pawn Movement"); (Without "SetupAttachment".)
@karasuZanu
@karasuZanu Жыл бұрын
@@ArthurPiroshkoff thank you.
@alertcriminal
@alertcriminal 7 ай бұрын
Tried adding EnhancedInput, when I tried to rebuild I got "Could not be compiled Try rebuilding from source manually" 3:41 Anybody know a fix
@Mittzys
@Mittzys 7 ай бұрын
Press "Yes," this will fix it. If it fails to compile, that means somewhere in your c++ code is an error. go in to the c++ code and fix all errors, and then try again.
@ChristopherFranko
@ChristopherFranko Жыл бұрын
Im not sure if im just really high or if Ive done some of this already?
@igotbit9454
@igotbit9454 Жыл бұрын
But you left out the most important part of an RPG in your course. Dialogue system with other characters. Missed opportunity.
@DruidMechanicsGameDevelopment
@DruidMechanicsGameDevelopment Жыл бұрын
I understand that there are lots of RPG features that people would like to see covered. It would be too long of a course to include them all which is why I am currently working on more tutorials to cover these topics one by one. For example, I'm working on a new course on GAS which will focus on skills/abilities.
@jackbrophy7179
@jackbrophy7179 Ай бұрын
well, it is a soulslike in the course so dialogue not the most important
UE5 C++ Enhanced Input - 4 - Using Two Dimensional Input Actions
16:46
Druid Mechanics
Рет қаралды 25 М.
UE5 C++ Enhanced Input - 5 - Directional Input to Move a Character
39:42
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 1,7 МЛН
UE5 C++ Enhanced Input - 2 - Bind C++ Functions to Input Actions
51:44
Druid Mechanics
Рет қаралды 66 М.
5 Tricks you (probably) don't know about Unreal Engine 5
10:44
Cinecom.net
Рет қаралды 381 М.
Sequencers and Animation Guide in Unreal Engine"
23:20
The Hommeyosh
Рет қаралды 82
The Most Common Mistake Beginners Make in Unreal Engine | UE5
12:17
Ali Elzoheiry
Рет қаралды 113 М.
UE5 C++ Enhanced Input - 1 - Core Concepts and Documentation
1:06:30
Druid Mechanics
Рет қаралды 79 М.
The Unreal Engine Game Framework: From int main() to BeginPlay
27:22
Alex Forsythe
Рет қаралды 210 М.
Enhanced Input and Pawns with C++ in Unreal Engine 5
18:25
Lively Geek
Рет қаралды 13 М.
C++ for Blueprinters | Unreal Engine
28:14
Unreal Engine
Рет қаралды 110 М.
Getting into C++ with Unreal Engine - Part1 - Setting up
34:49
Multiplayer in Unreal Engine: How to Understand Network Replication
22:08