Hello, I’m a begginer at Unreal and this is my first question here, sorry for any grammar mistake.
So, I’m making a first person and third person game (you can change cameras in-game) and when my character is in idle pose, if I move the camera to see around, the character’s body moves with the camera and keeps static - he stays on idle animation. When he walks, it’s all fine, the way I want. What I want to do is that while he’s stopped, I might be able to move the camera around and he keeps stopped, and only his head moves with the camera. Also, something I want to do is set max and min limits for the camera rotations. For example: the X axis (I think) sets the camera’s left/right rotation, and it goes up to 360º, and I want to set the max rotation to 180º or less, to make it more realistic.
I’ve tried unchecking Pawn rotation on ThirdPersonCharacter(self) and then checking Orient Rotation to Movement and also checking Ignore Base Rotation, and it worked for the idle, but only for the idle and only for the third person mode. When the player walked, the rotation was a mess, and when I changed the camera to first person mode, if I moved the camera back, it collided with the player’s mesh.
Obs.: I think it would be a good idea if I could forbid the player to move backwards, to make it easier.
I know this isn’t easy, but it would help me a lot.
(First person camera, with Pawn checked) - http://gph.is/1XZEtpB
(Third person camera, with Pawn checked) - http://gph.is/25Epfc3
Gifs are too long to put here.
"What I want to do is that while he’s stopped, I might be able to move the camera around and he keeps stopped, and only his head moves with the camera. Also, something I want to do is set max and min limits for the camera rotations."
Firstly, as you said that disabling the pawn rotation only working for idle. you could setup a check on a timer or tick - saying that if the characters speed is = 0 set Pawn Rotation to false. If character movement >=1 then set it to true.
Otherwise you might need to do some more complex stuff to get that working.
what you are trying to do really is use the mouse to control both the head only - and the body depending on if they are idle or not, which is two completely separate ways of camera movement (plus the character itself will need to have animations for moving the head alone"
Secondly for the sex max limits you can use a blueprint command called “clamp” it allows you set min/max values , so if 40 is the min and 60 is the max, anything above 60 gets set to 60, anything below 40 gets set to 40.
"Obs.: I think it would be a good idea if I could forbid the player to move backwards, to make it easier."
To stop them moving backwards permanently just remove the back binding - If you want them to just sometimes not be able to, then I would suggest setting up a Branch command where the “movement” is. you can then use some sort of Boolean variable to determine if they should be allowed to move backwards or not.
IE. if the boolean is set to false then you can just leave the false part of the branch empty and nothing will happen until its True.
Screenshots of your setup might make it easier to fix any problems you have with this. (plus if you send in any screenshots I can recreate what you have on my side and just makes changes to show you how it could be done rather then just a ton of text"
Thanks a lot for the quick anwser. Please, let’s try to do things step by step. As I see, it’s harder than I thought, especially for me hahaha. I think we should focus on the main idea of the game, that is First Person. So, I wan’t to, while idle, my character to stop and only my camera move and has rotation limits (forget about the head for now, it was just a detail hahaha), and to do this I need to create a clamp right? I have found it on my blueprints and understood its function, but I have no idea on how to start using it and where to connect it, I’m really new at this. I also think I understood about disabling the pawn rotation with a tick event, and the tick is already in the BP, so I created a sequence (because I have another function for the tick) but then I tried to getuserpawnrotation or something similar and couldn’t find anything.
About the screenshots, do you want me to send all the character Event Graph Blueprint here or just some parts of it?