0
Not a bug

FPS camera Broken and extremly glitchy? Or do I miss something?

contact 8 months ago in Shooter updated by Marti (Lead Developer) 8 months ago 12

I get strange stutters and camera behaviour when using the Game Creator ''Player'' and set it to FPS. The setup is as following;

1 Create an ''Player'' In an empty Unity game and place it on an simple Box mesh

2 add an ''Camera Motor'' to the Player'' and link it to the main camera. 


If I build the game it even gets worse in the final Build version! Movement buttons W.A.S.D. get mixed up and the camera shakes all over the place in an final build. It is impossible to control any movement at all.

I don't know why this FPS is not working? I hope I do something wrong and can fix this issue. 


Including content: Video of the behaviour in editor, plus 2 pictures showing the setup.



Unity version:
Game Creator version:

Answer

Answer
Not a bug

The Camera motor should not be added to the Player. Instead, create an empty game object outside and place the Camera Motor there.

If you create the motor inside the Player, it will add the Player's movement on top of the motor's motion, showing this stuttering effect.

GOOD, I'M SATISFIED

i got it working now, but the setup can get broken very easy if one step is wrong in the proces? I have to give this positive feedback, Marti responds fast. 

Satisfaction mark by contact 8 months ago

I want to add something to the story: In the Build the Mouse Pointer is still visible on the screen.

Answer
Not a bug

The Camera motor should not be added to the Player. Instead, create an empty game object outside and place the Camera Motor there.

If you create the motor inside the Player, it will add the Player's movement on top of the motor's motion, showing this stuttering effect.

I still have thesame problem. I created an empty object > added ''Camera Motor''. Created new ''Player''. Nothing seems to solve this issue. Could You explain mayby where ''exactly'' to add which Camera components? I see some ''Hooks'' get automatically created under the main camera. Mayby I make an mistake or organize the components wrong? 

The main camera (During one setup the camera only stays static and not connected to the player. When the camera gets connected it will stutter under every single setup I tried so far.

The gameobject

The Player


I found out that when You do ''not'' refference to an camera moter in the Main camera ''Camera Controller script'' (which is added automatically) then the FPS will play a bit smoother (the camera Moter is created within an empty object as You asked ) this setup feels differentl. However the camera is then inside the character Mesh which is not hiding at all (checked the Hide Character box). But now the following errors come to light:

- The Mouse pointer is not in the center of the screen but towards the left above corner

- This will cause when pressing the ''W'' button to walk in circles automatically and not in an straight line.

- Also the mouse is inverted, moving the mouse pointer up will make the camera look down.

Still confused why this FPS mode is not working.

A video of the camera setup as it should be?  You see how the character behaves. At an certain moment it wil start walking circles. I need the FPS controller and am stuck now in my entire project. 

Made an new video, also in Adventure camera mode the stutter is visible. 

Included another Video: Showing the Build ingame experience. The Mouse pointer is visible in the Build, also when Moving forward it will walk slightly off to the left, plus heavy stutters. I tried everything as described in the tutorials and dont understand what is going on?

Hi Contact;

I don't really see any stuttering on the videos, but that may be due to the compression of the video. I'm unsure how you've set up the camera, so here's what you should have. Each bullet is a separate game object at the root of the scene.

  • Player
  • Main Camera with the component Camera Controller
  • Camera Motor with the Camera Motor component, set to FPS Motor.

The way the camera system works is the following: The Camera Controller references zero or one Camera motors at a given time. When it references one, the motor feeds information on the camera controller so it behaves as the motor says.

A reason why the camera might stutter, however, could be because you have no "damping" set. Damping is set in the Camera Controller component and should have a value of around 0.1.

Bear in mind too though that stuttering could also be caused by a low number of frames per second. The Unity Editor adds quite a lot of performance overhead, so try also building your game and see if the frames per second are over 30.

You say the stutter is due to the compression of the Videos or an framerate problem. This is not true! I have no problem with other FPS assets for Unity. I tried again Your setup, all with bugs and errors.

I was carefull about this but You are not fair here. If Your camera element was indeed without problems I should not have those from the start. It is just not working and I am not alone.

Sorry to hear you're having problems, but I'm just trying to figure out what your problem is. Apart from models clipping through I see no stuttering of the camera on this videos.


You put the camera motor on the Player game object and told you that's not how it works. I posted how to set up the scene with the First Person motor. Have you tried that? Can you tell me whether it did work? If not, can you post some screenshots showcasing this, or a video going over the scene setup? Otherwise it's impossible for us to help you.

I am thinking of creating an tutorial, It works now. If the camera setup is done in the wrong order, This is an tricky part of Game creator existing of multiple elements:

- main camera

- player

- camera motor

i have these all seperate from each other in the hierarchy.

Then multiple elements get created automatically, I dont know if this is true, but if the order in which the above is created is wrong, hook scripts can get mixed up wrong? Interferring mayby with the ave/load element? I am just shouting thoughts. Probably I just failed myself in misunderstanding this :) 

I still have to figure out how to remove the mouse cursor, plus my character falls trough the floor. The collision does not collide with the player?

Scripts won't get mixed up. Most likely what happened is that you first created the Player. When creating an object, Unity automatically selects the created object. If you try to create another object while having one selected, it will create the new object as a child of the first one.


As for the second question, I've already answered via email, following your question. However, if there's something else, please make sure to create a separate topic for different questions.

Cheers!