Jump to content

Strange character controller :


Recommended Posts

I use this code modified :

 

 

 




function Script:UpdatePhysics()
local window = Window:GetCurrent()

local up
local Down
local left
local Right

local move
local strafe


if window:KeyDown(Key.Up) then
up = 1
else
up = 0
end


if window:KeyDown(Key.Down) then
Down = 1
else
Down = 0
end


if window:KeyDown(Key.Right) then
Right = 1
else
Right = 0
end


if window:KeyDown(Key.Left) then
left = 1
else
left = 0
end

if move ~= 0 or strafe ~= 0 then
self.entity.animationmanager:SetAnimationSequence(1,0.04 ,200)
else
self.entity.animationmanager:SetAnimationSequence(2,0.04 ,200)
end





move = (up - Down)*4

strafe = (Right - left)*4

self.entity:SetInput(0,move,strafe)

end

 

The character runs and strafe, but it is like each 2 seconds it collides or do some strange weird offset, it results a breaked movement visually (the animation is clean and smooth loop, i verified it in Blender also).

 

So could that come from this function ?

self.entity:SetInput(0,move,strafe)

 

Does this work with NavMesh or a thread in background ?

Stop toying and make games

Link to comment
Share on other sites

Strange , i put characters clickes "Fit Shape" each time and the values where not calculated :(

 

I just putting a BSP cube to test without animation code.

"Fit Shape" worked, and the cube moved right.

 

Next i put again a custom character, not "Fit Shap" WORKED ?

The values was calculated , and the code and game just runned well.

 

IS not some LE 3 problem in the meomory cahs, or the level or something like that ?

Caus after running the level when it didn't worked , by stoping it, the values was put automatically ("Fit Shape" did'nt worked manually) ?

Stop toying and make games

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...