Comments (13)
Per Conna's advice, changing the code of ducc 3 so that the player transform is only updated in FixedUpdate fixed the issue. This incorrect code came from the Walker player controller, so that should probably be updated: https://github.com/Facepunch/sbox-walker/blob/main/Libraries/playercontroller/Code/PlayerController.cs
from sbox-issues.
This or a similar issue seems to be affecting the game "ducc 3", which uses a mostly unmodified PlayerController library from Facepunch.
from sbox-issues.
Hope this videos helps displaying the issue.
At first I am moving forward and strafing by tapping A and D.
Then on the way back I just move forward and strafe by moving my mouse.
You can see that on the second attempt the gaps are uneven and sometimes bunched up.
In the video I am noclipping, so just setting the position with Input.AnalogMove * Input.AnalogLook
test.mp4
from sbox-issues.
With the "noclip" one are you setting the position in FixedUpdate or Update and are you multiplying by Time.Delta? Infact can you just post repro projects it'll make it a lot easier to fix.
from sbox-issues.
Sure give me one sec I'll set up a repro
from sbox-issues.
There we go, a shrimple repro.
repro.mp4
from sbox-issues.
I think when you assign Transform in OnUpdate it clears the interpolated values assigned in OnFixedUpdate without applying them. It's using the old position values.
from sbox-issues.
I'm gonna say this is currently by design. Here's why:
We automatically interpolate transforms that are set within a Fixed Update context so that movement appears smooth. But, when outside of a Fixed Update context, setting a transform will clear any interpolation and set it to whatever you want it to be immediately.
The problem you're experiencing is not knowing this behavior.
Really you should either do all of your Transform updates in OnFixedUpdate or OnUpdate but mixing both will conflict.
You can see the problem in the repro is resolved by simply moving
Transform.Rotation = Rotation.FromYaw( EyeAngles.yaw );
from OnUpdate
to OnFixedUpdate
.
from sbox-issues.
Seems like the behavior used to be that setting only rotation in update wouldn't effect the interpolation of position, which seems like it would be the ideal behavior, any chance we could get that back? It isn't very intuitive that setting rotation would fuck up position
from sbox-issues.
That makes sense, although I see a lot of people encountering this in the future.
I'll make sure to go over it in future tutorials as my current ones use the old method.
from sbox-issues.
Don't just yet - nothing is final - I want to find the right balance for all the use cases and for it to feel intuitive.
from sbox-issues.
What are the use cases for wanting to set rotation in OnUpdate and position in OnFixedUpdate? Wouldn't setting both in OnFixedUpdate and interpolating achieve the same result?
from sbox-issues.
Generally games have player movement code (dealing with position) in fixed update, but camera movement has to be in update to avoid it feeling floaty. My project had the position of the camera gameobject set in fixedupdate by the ducking logic and the rotation set in update by the mouse look logic. Now I have 2 gameobjects, one dealing with position set in FixedUpdate and the other dealing with rotation set in update (which works fine but I don't think I would have ever thought to do it without seeing the comments here)
from sbox-issues.
Related Issues (20)
- ExecuteInEditor doesn't run OnAwake and OnEnabled when opening the project
- After updating project setting Lobby Size, Quick Play no longer works as expected.
- Error stack trace lines do not match up in files where codegen has occurred
- vmdl_c is not sent to joining client if file size is under 64KB and project is not published
- Triggers can't be simultaneously activated if they have a shared parent with a rigidbody
- Add .sbs/.sbsar support/integration. HOT 1
- Add a maximum bandwidth option.
- Allow developers to report their own "errors" and logs to the backend
- `MorphCollection.Set` restricted in [0,1] range
- Hide the error banner in games for players that do not belong to the organization
- Donβt include `Log.Error` in error percentage
- Disabling the Console on a per game basis
- [Platform] Per player data store. HOT 2
- Divs not updating after a Razor Panel update HOT 1
- [Scene Mesh] Ability to center the origin of a SceneMesh mesh
- no audio HOT 1
- [ShaderGraph] Add nodes for i.vTangentUWs.xyz & i.vTangentVWs.xyz
- Game will not boot in VR mode when running in proton HOT 1
- Servers show Host's friend's nicknames in server player list
- Hitboxes are acting as if they are double the size when using hitboxes from model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbox-issues.