Hi All,
I'm back at using Leadwerks Engine, boy have I missed it.
I've been playing around with the 3rdPerson script and so far able to add some changes and functions I desire. For example, the camera free look only works now if right mouse button is held, also animations integrated and speed changed etc.
Feel pretty good in doing these small things and breaking / fixing the code.
I've come to a bit of a stump though, hoping the trusty Leadwerks community can assist.
1. I want the mouse free look to still be active without holding the right mouse button down, but i dont want it to change the angle / direction of player like the default. I tried adding the same code as default without the right mouse button code, and removing some Angle entity code thinking thats was moving the player.. but i cant get anything to work. Any assistance please?
-- Free Look. If Right Mouse Button Held Down.
if self.lockcameraangle==false then
if window:MouseDown(2) then
local mousepos = window:GetMousePosition()
window:SetMousePosition(cx,cy)
local mx = Math:Clamp(mousepos.x - cx,-45,45)
local my = Math:Clamp(mousepos.y - cy,-45,45)
if self.smoothedmousemovement~=nil then
self.angle = self.angle + mx * self.lookspeed
else
self.smoothedmousemovement=Vec2(0)
end
self.smoothedmousemovement.x = Math:Curve(mx,self.smoothedmousemovement.x,self.looksmoothing)
self.smoothedmousemovement.y = Math:Curve(my,self.smoothedmousemovement.y,self.looksmoothing)
end
end
Secondly, I don't want the player to strafe, instead to turn instead. Strafing with the walk animation active just does not feel right. I've tried removing strafe code and adding my own self.Entity:Turn but it wont work.
Any assistance with that is welcome?
Finally, I've add my jump animation and works lovely if i jump once on the spot, soon as I'm moving forward and hitting jump it does not play animation? cant seem to fix it adding in various varible flags etc....
Many Thanks in advanced!