I’ve recently begun using UE4 and I’m aspiring to create my own game through it, however I am having some difficulties with some stuff.
At the moment I am trying to set up a camera rotation through the use of the “Mouse X/Y” inputs.
For some reason neither of the two are giving me any output values.
I have my camera controls all located in the event graph of a pawn I have placed in the editor, other camera movement such as left/right & up/down are working in this set-up.
Do I have to move my camera to a different BP type such as actor or is there some setting I have overlooked when reading the input from the mouse?
You could show us your efforts, than we can think about what could be wrong. Maybe the MouseX/Y is working different than you think they do (:
Sure, here’s an image showing the section with the issue.
As you can see I am watching the float value on Mouse X to check for any output but there is none when I run the game in editor, the pawn is set to receive input from the player automatically as well.
What I’m wondering is how can I register mouse movements and receive the output on a pawn.
When you posses a Pawn, camera will follow PlayerController rotation if you have Use Controller View Rotation in Camera setting, then you just need update Controller rotation through Add Controller Pitch Input for Y Input and Add Controller Yawn Input for X Input.
If you want to control camera just turn off option above, but i recommend you control PlayerController rather than camera.
Ok i just checked this (cause i never used this Mouse X node).
Would you mind using the other Mouse X node?
The one at the button. That provides only the value and doesn’t trigger.
Use the event tick for printing that value and check if he prints you something else than 0 when you move your mouse. Because it my test, BOTH gave me a value when i moved my mouse.
I only use a custom character based on the main character class.
And in its BP event graph i used the two nodes.
But since you say you are using it on the pawn, i don’t think we have it differently placed.
How can I possess the pawn in a proper manner?
I have tried setting up pawn BC’s to possess in the event graph of my Player Controller but I don’t receive any asset to possess in the drop-down list, do I need to make a “special” pawn to possess or?
Also I’ve noticed the Player Controller has some inputs that are not in the pawn class…
Is it possible to get by with smaller BC’s if I use the Player Controller?
In GameMode blueprint and in that you can set DefaultPawn to your pawn, when you start with that GameMode it will auto possess that pawn.
Other way you can do in Level Blueprint, drag the pawn you want to possess in level, at event Begin Play, Get Player Controller and Possess then choose the Pawn you want to possess.
For why you don’t have anything on the drop down, because Blueprint it’s a class, what you want to set is the Instance of Pawn class, so you can only set an Instance at run time, or an Instance in level.
Sorry for the late reply, was sure I commented this yesterday.
I tried using both the different input types (events & values) for X and Y respectively but couldn’t get it to work.
Ended up making a new project where at first the X/Y got registered fine and I got an okay rotation set up for my camera. Today it’s not functioning, yay!
Is it possible to do this on a regular pawn or does it need to be an actor/character? I am unable to get any input whatsoever for my pawn, and my Player Controller will not receive any input either for some reason.
Found the solution when I made another question here on the answerhub
- “Use mouse for touch” was checked under the engine input section, apparently this overrides other mouse actions.