Jump to content

Need help - Platformer controller & some lighting troubles


REX-RUS
 Share

Recommended Posts

Hi.

 

I use the script created by Josh for platformer (can't find a link to it), and have a problem.

The character controller is placed in the centre of the cylinder. How to attach it to the bottom edge?

 

 

Script.movespeed=5--float
Script.cameradistance=20--float
Script.camerazoom=8--float
Script.orthographiceffect=1--float "Flatness"
Script.camerarange=10--float

function Script:Start()
self.camera = Camera:Create()
self.entity:SetPhysicsMode(Entity.CharacterPhysics)
self.camera:SetRotation(0,0,0)
self.camera:SetZoom(self.camerazoom*self.orthographiceffect)
self.camera:SetRange(self.cameradistance*self.orthographiceffect-self.camerarange,self.cameradistance*self.orthographiceffect+self.camerarange)
self.playerangle=90
self.camera:SetDebugPhysicsMode(true)
if self.entity:GetMass()==0 then self.entity:SetMass(10) end
end

function Script:UpdatePhysics()
local window=Window:GetCurrent()
local move=0
if window:KeyDown(Key.D) then move = move + self.movespeed end
if window:KeyDown(Key.A) then move = move - self.movespeed end
local jump = 0
if window:KeyHit(Key.Space) then
jump = 10
end
if move>0 then self.playerangle=90 end
if move<0 then self.playerangle=-90 end
self.entity:SetInput(self.playerangle,math.abs(move),0,jump,false, 1.0, 0.5, true)
end

function Script:UpdateWorld()
--Update camera
self.camera:SetPosition(self.entity:GetPosition())
self.camera:Move(0,1.8/2,-self.cameradistance*self.orthographiceffect)
end

 

 

 

I noticed a nasty light bug. Dynamic source shines through the walls. I have configured it incorrectly?

 

Operating System: Windows 10 home x64 / Mint 17.3 x64

Hardware: Core i5 480m // 6 GB DDR3 // Nvidia GF GT540m 1Gb GDDR3

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...