Jump to content

Character controller jittering ?


YouGroove
 Share

Recommended Posts

i saw that from Aggror :

 

Script.target = "" --entity "Target waypoint"
Script.offset = Vec3(0,1,-2) --Vec3 "Offset"
Script.smoothen = Vec3(5,5,5) --Vec3 Smoothen
Script.enabled = true --bool Enabled
function Script:Start()
if self.target == nil then
Debug:Error("The follow script does not have a target.")
end
end
function Script:UpdateWorld()
if self.enabled then
local x = Math:Curve((self.target:GetPosition(true).x + self.offset.x), self.entity:GetPosition(true).x, self.smoothen.x / Time:GetSpeed())
local y = Math:Curve((self.target:GetPosition(true).y + self.offset.y), self.entity:GetPosition(true).y, self.smoothen.y / Time:GetSpeed())
local z = Math:Curve((self.target:GetPosition(true).z + self.offset.z), self.entity:GetPosition(true).z, self.smoothen.z / Time:GetSpeed())
self.entity:SetPosition(Vec3(x,y,z))
end
end

 

not tried but sure it will work

AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11

Link to comment
Share on other sites

Something going super wrong, don't knwo what ?

All physic settings are good for character controller, and SetInput has good parameters ?

Tested with simple physic cylinder and PhysicSetPosition with different values as last parameter, but well the jittering is still present ?

Super strange as other aliens call Goto navigation function without jittering problem ?

 

-----------

 

Deleting most of the stuff on level, keeping BSP only, re adding player, map re worked, but well , all level work is lost.

Using SetInput the character is still jittering a little ? even setting friction to low has no effect

Perhaps it's more perceptible because i put all animation paused even during walk/run.

Stop toying and make games

Link to comment
Share on other sites

Seems the map has a problem.

I add character player with original size, added char controller and script, launching game just terminated.

I removed character and it's script, all the rest is just level no more entities i got no Exception, but runing the map in debug or run mode, it just crashes : program terminated.

 

Well another strange stuff going on with the map file or some cache code or some problem to clean objects references in the map file perhaps :(

Stop toying and make games

Link to comment
Share on other sites

ok, it seems it's some character controller friction problem , even trying SetFriction do not changed that.

In FPS view it's not very perceptible and occurs specialy when turning on some direction.

In TPS , but camera far from camera it's not perceptible, and if you add character animation it will be more hard to see.

 

So character controller is a physic cylinder really sliding on surfaces.

 

How to avoid that visible jittering if TPS camera near character ?

 

I think i have some solution :

1 ) Put some small cube model for character attach Physic character controller.

2 ) Then calculate at each frame a smooth move between last position and actual character controller position

3) Place your animated player model at the position of the smooth move calculated.

 

It won't be a big delat between real char controller position and the calculated smooth move, something very tiny, but at least smooth move should totally hide the light jittering problem.

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...