Search the Community
Showing results for tags 'controls'.
-
So i've been trying to figure this out for a bit now and it's the one thing that's been holding me up on my project. I want to get tank controls similar to the games of old like resident evil or parasite eve but the issue i've been having is that i have no idea how leadwerks handles this, on one hand i've been trying to build up different directions based on a variable that goes from 0 to 360 and trying to build lines of code based on every few increments and have it so the player changes their movement based on it and where they might be facing but i've gotten to the point where i feel like leadwerks might have something to determine something like this already. So i want to ask for a bit of help since i couldn't find any information on this. Is there a command or a built in way to set the facing direction of the character based on the turning or rotation of the model and make it move in a set direction based on it's rotation?
-
Hi guys, I searched the forum a bit and found out that other people had the same issue as I have now. You maybe know that if you have a key check (like window:KeyHit() or window:MouseHit()) in multiple scripts then only ONE of the works as expected. I read that its because Leadwerks sets the hit check value to false right after you checked it. However I tried to find a solution for this, by making a "class" where I call all keychecks, unfortunately the problem remains, maybe you can help me? What have you come up with? Thats my attempt: Thats the class script: function KeyCheck(script) local key = {} function key:MouseClicked(command) if command == "Left" then return window:MouseHit(1) elseif command == "Right" then return window:MouseHit(2) end end return key end These are two test scripts: import "Scripts/+Morra Scripts/System/KeyCheck.lua" local keyCheck function Script:Start() self.loadClass = KeyCheck keyCheck = self:loadClass() end function Script:UpdateWorld() if keyCheck:MouseClicked("Left") then System:Print("Test1") end end import "Scripts/+Morra Scripts/System/KeyCheck.lua" local keyCheck function Script:Start() self.loadClass = KeyCheck keyCheck = self:loadClass() end function Script:UpdateWorld() if keyCheck:MouseClicked("Left") then System:Print("Test2") end end I only get printed "Test1", due to this script seems to be called faster than the second one.
-
Can anybody send me a template script for a third person control scheme that of old school games? I'll show a couple of examples of what I'm trying to code, but I'm still new to LUA and would like a template to work off and learn! I'd like my camera to act similar to either of those and the character to control in that "tank controls" movement.
- 1 reply
-
- 3rd person
- third person
-
(and 1 more)
Tagged with:
-
My lua project was fine and I left it for a few weeks. Now when I load it up the vehicle's forward/reverse controls are reversed. Couldn't figure it out so I created a new project with just flat terrain and shadmar's prefab car. Reversed controls.. Anyone else experiencing this or did I mess something up?