Braqoon Posted September 24, 2018 Share Posted September 24, 2018 Hi, This might be trivial but not sure how to solve this. I have crated a simple model in Blender with texture and exported it to .fbx. Imported that to Leadwerks without issue, set collision mesh and placed in 3D space (see attached pic). This is my character in the game , Roomba like cleaning robot. So when i start the game , robot gets flipped 90 degrees. What gives ? When i create a simple cylinder, size of of my object and attach my player script all is fine, cylinder does not flip, and works just fine. Not sure what's going on, any help apprecieated. Player script below. function Script:Start() --Create a camera world:SetAmbientLight(0,0,0) self.camera = Camera:Create() --Update the camera self:UpdateCamera() --Initial Vars self.entity:SetMass(1) self.entity:SetPhysicsMode(Entity.CharacterPhysics) self.pos = 0 self.minimal_speed = -3 self.max_speed = 3 self.lives = 3 self.speed = 0 self.tilt = 0 energy=100.0 energy_max=100.0 energy_min=0 self.energy_depletion = 0 self.lastTime = Time:Millisecs(); self.torch = PointLight:Create() end --Adjust the camera orientation relative to the ball function Script:UpdateCamera() self.camera:SetPosition(self.entity:GetPosition()) self.camera:SetRotation(45,0,0) self.camera:Move(0,4,-7) end function Script:UpdatePhysics() --Get the game window local window = Window:GetCurrent() end function Script:UpdateWorld() --Update the camera each frame if energy > 0 then -- move if you got energy local move = ((window:KeyDown(Key.Up) and 1 or 0) - (window:KeyDown(Key.Down) and 1 or 0))*3 local strafe = ((window:KeyDown(Key.Right)and 1 or 0) - (window:KeyDown(Key.Left) and 1 or 0))*3 if window:KeyDown(Key.Up) or window:KeyDown(Key.Down) or window:KeyDown(Key.Left) or window:KeyDown(Key.Right) then if energy > 0 then if (Time:Millisecs() > self.lastTime + 80) then self.lastTime = Time:Millisecs(); energy = energy -1 end end end self.entity:SetInput(0,move,strafe) else -- out of energy, can't move move = 0 strafe = 0 self.entity:SetInput(0,move,strafe) end -- Light --light = SpotLight:Create() self.torch:SetPosition(self.entity:GetPosition()) self.torch:SetRange(0.2,1.5) self.torch:Move(0,1,0) --self.torch: self:UpdateCamera() end function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:DrawText(energy,context:GetWidth()-30,4) end Quote Link to comment Share on other sites More sharing options...
Josh Posted September 24, 2018 Share Posted September 24, 2018 You can collapse the model in the model editor window and this will reset the rotation to 0,0,0 and then it will work with character physics. If you need to adjust the rotation further around the Y axis there is a character angle physics setting available in the editor for this purpose. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted September 24, 2018 Share Posted September 24, 2018 9 hours ago, Josh said: You can collapse the model in the model editor window and this will reset the rotation to 0,0,0 and then it will work with character physics. That feature is not present under the Linux build. ? Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Braqoon Posted September 24, 2018 Author Share Posted September 24, 2018 Ouch, yeah that option is not available on Linux Build 4.5. Any other suggestions ? Trying to set Rotation in general settings makes no difference. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.