0
Fixed

Player Holding Ball in First Person

Crispy 10 months ago in Game Creator updated by Marti (Lead Developer) 10 months ago 14

I want the Player to hold a ball in First Person. I've set the ball as a child of camera.

Throwing the ball while stationary is fine, but when I move left, right, or forward, the ball shakes after thrown. See video: 

https://streamable.com/uv6zr


I think this is due to the ball going inside the player collider when moving, since ball is a child of camera, and there a transition time on camera. See video: 

https://streamable.com/e7qt3

I've also tried setting ball as a child of Player, with Hide Player Model toggled off on the camera motor, and the Player model's skinned mesh renderer off. This is what happens, but with the skinned mesh renderer on: 

https://streamable.com/sbtub

I think the solution is to be able to turn off the camera accelerating and decelerating.

Unity version:
2018.4.7f1
Game Creator version:
0.9.9

Answer

Answer
Answered

For a detailed explanation, see this post: https://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8

Solution: Check your ball prefab and in the Rigidbody component change the Interpolate property to Interpolate (instead of None).

Explanation: This is due to the Physics engine runs a fixed time step and it's impossible to sync the movement of the camera, which runs inside the main thread. Interpolating sets the position of the Rigidbody every render frame (interpolating the result given by the latests Physics frame), hence showing smooth movement.

GOOD, I'M SATISFIED
Satisfaction mark by Crispy 10 months ago
Under review

Are you unparenting the ball when throwing it? This jittering is usually due to the ball trying to inherit the camera's movement (the jitter only occurs when you move) while taking into account the physics applied.

I'm not doing any sort of unparenting. I'm hiding the ball, then instantiating another ball at ball position with Impulse physics. What should I be doing?

The reason why your character seems offset is because the first child of your Player's character is not at (0,0,0). Hence why it looks like this.

As for the jittering, post how you instantiate and apply force to the ball. Could also be that the physics update rate is lower than the game's main update rate.

I think you're wrong about the offset. See video: https://streamable.com/skm1j

The following shows how I instantiate the ball:

Answer
Answered

For a detailed explanation, see this post: https://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8

Solution: Check your ball prefab and in the Rigidbody component change the Interpolate property to Interpolate (instead of None).

Explanation: This is due to the Physics engine runs a fixed time step and it's impossible to sync the movement of the camera, which runs inside the main thread. Interpolating sets the position of the Rigidbody every render frame (interpolating the result given by the latests Physics frame), hence showing smooth movement.

That definitely made it a lot better.

Could you explain what's going on with the colliders in the video? https://streamable.com/skm1j

Not sure this is related to the colliders. Seems your character offsets automatically. It's either a thing of your 3D model (check the sub objects it has) or another Animator using root motion. Try using a different model and check if this happens too

This should not happen by default. I see you have third-party code being used. Try creating a project from scratch and place a Player. It should work. Then, try adding each of the packages you have on your game project and test one by one, which one is adding that offset.

Made a new project. Unity 2018.4.7f1. Installed only Game Creator (0.9.9). Added Player. Added First Person Camera Motor. Same behavior.

We can't reproduce this. We installed Game Creator on a fresh project and everything seems to work fine. Could you make a video showing the process? Or clear reproduction steps so we can narrow down the problem.

Planned

Hi, I managed to reproduce this. Seems this only happens when the FPS camera motor is set with the Hide Player property set to True (so the 3D model is not displayed). I'll open a ticket and have this fixed for the next iteration. Sorry for the inconvenience!

Fixed

I'm marking this issue as resolved as I've already patched the bug. The fix will be shipped with version 1.0.1. No further action from the user will be needed. If after updating you still see this problem, feel free to reopen this ticket.