HI, recently i learned that if you want to make a simple print with the use of a specific key, so like: key-event-(P) → Print String = does not work ( think of this as blueprint nodes )
but
Event BeginPlay → Enable Input (Player Controller) → Get Player Controller and then
Key-event-(P) → Print String = this works
why is it that this works, i thought only key event and print string was needed for it to be able to print to the screen
this doesnt print hello
but
this works
why?
i could definetly be wrong about this, but remember using key events does work without the enable input and now that i have learned that enabled input is needed, it little confusing for me
Regular actors do not process input by default, it’s disabled but can be enabled in the class defaults or with nodes, like you did. This would be undesireable in 97,8% cases, though. Imagine you have 3 actors like that. Which one goes first, perhaps all at the same time?
Pawns, Controllers and Widgets is where you want to handle input; it’s enabled by default. In most scenarios, the controller acts as a will of the player. If I want to press F to chop down a tree, I’ll put the F in my Pawn that does the chopping rather than in the 100k trees in the level.
You may, ofc, be developing a clever puzzle game where there is no player, no pawn or even a controller. Actors stacking input could make sense.
Level Blueprint is also happy to handle input. Perhaps every game level is totally unique and you do not want to make 70 pawns and Game Modes.
so by my understanding, i can do it on actor but most of the time i shouldnt make a keyevent in actors. which when i think of it, it makes sense not to make key event in actors xd.
i guess pretty much answered my question, thank you for answering