So, quick preface: I learned coding in Game Maker, moved to Unity years later, and now I’m gunning for Unreal. C++ is giving me a lot of trouble but I’m starting to catch onto some key concepts which I’m finding simply aren’t explained anywhere.
Like, initially I didn’t realize that InputComponent control bindings were basically setting up a function that’s called when that input is recognized (that’s what it does, right? I’m following a lot of tutorial/example code and it’s really hard sometimes just to tell what I’m looking at), and that trying to #include additional things wouldn’t enable me to use that if the parent class isn’t a Character. I’m still not 100% sure how I’m “supposed to” handle components, code-wise. Movement goes on the Character class, then if I want to add something like a weapon system I’d add an ActorComponent for it? If I choose the wrong kind, do I have to go through the trouble to erase it completely and remake it with a different parent class?
Right now, I’ve managed to make a PlayerMovement Character class and add (empty) functions for x/y movement and camera control, and bind them to inputs. And it took me hours to do that without Visual Studio hitting me with errors. Headers seem annoying to deal with, but they’re starting to make some sense.
Now, I want to bind vertical camera movement basically 1:1 to the gamepad’s Y axis. That is, I don’t want to “add” vertical movement to the camera; I want to set it directly. What would be a good way to do this?
I figure I want to bypass AddControllerPitchInput(), forget about AddPitchInput(), and directly assign a value to RotationInput.Pitch in PlayerController.cpp. I can’t tell if this is possible, though. And if it is, how would I gain access to that variable and change it from my script?
I still feel like I’m missing some really basic, key understanding here which would go a long way toward helping me feel comfortable working in C++ the way I do in Unity’s C#. But I’m determined to see this through, and I really don’t want to dig into blueprints. Any pointers?
[SUB](Just want to point out because this feels like a very low level plea for help, I have read through several beginner coding tutorials at this point. A few have helped, but many of them were total dead-ends for me. It seems there are a lot of concepts they just don’t explain, which means the tutorials are just rote code copying or trying to teach basic game logic concepts I’m already pretty well aware of given my prior experience. The help I need is unfortunately almost impossible to find through a quick search.)[/SUB]