It does not have this odd behavior in Sponza,which is odd because Im following the exact same behavior , given im using the script from sponza and simply loaded the box mesh and duplicated it as shown in one of the tuts for maratis online.
I then created the values as given in sponza and it works fine except for these few things..Ive double checked and I simply can't find what I've got incorrect here, but yes I'd be happy to post script Im using .
My script which is exact duplicate of sponza script:
-----------------------------------------------------------------------------------
-- Maratis
-- Jules script test
-----------------------------------------------------------------------------------
-- get objects
Player = getObject("Player")
Head = getObject("Head")
dx = 0.0
dy = 0.0
centerCursor()
mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")
-- scene update
function onSceneUpdate()
-- rotate Player (X mouse)
rotate(Player, {0, 0, -1}, dx*100)
-- rotate Head (Y mouse)
rotate(Head, {-1, 0, 0}, dy*100, "local")
rotation = getRotation(Head)
if rotation[1] > 90 then
rotation[1] = 90
elseif rotation[1] < -90 then
rotation[1] = -90
end
setRotation(Head, rotation)
-- move
if isKeyPressed("UP") then
addCentralForce(Player, {0, 3, 0}, "local")
end
if isKeyPressed("DOWN") then
addCentralForce(Player, {0, -3, 0}, "local")
end
if isKeyPressed("LEFT") then
addCentralForce(Player, {-3, 0, 0}, "local")
end
if isKeyPressed("RIGHT") then
addCentralForce(Player, {3, 0, 0}, "local")
end
-- get mouse direction
dx = getAxis("MOUSE_X") - mx
dy = getAxis("MOUSE_Y") - my
-- center cursor
centerCursor()
mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")
end
My box.mesh ( brought in direct from sponza DIR) has properties in editor, which match their sponza values, as does head and camera, so I'm lost as to what I'm doing wrong here . My parenting is also precisely matching sponza example as are all other value, afaict.
I realize I could just use sponza mproj and del building and load my mesh instead, but I'd rather know why what I'm doing isn't having intended effect so I can learn Maratis effectively.
thx
Gm