DjPoke Posted November 19, 2024 Posted November 19, 2024 Hi, I've attached FPSControllers script to a camera. I've scaled the camera to enter rooms in my map, but even if I set a very little scale size, it refuse to enter. An idea ? Quote
Dreikblack Posted November 19, 2024 Posted November 19, 2024 FirstPersonControls seems to overwrite fov value. Try to comment "self.camera:SetFov(70)" line in FirstPersonControls.lua Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted November 19, 2024 Posted November 19, 2024 Actually it's even create a camera. FirstPersonControls should be attached to a model or pivot (empty). Model can be invisible with renderLayers 0 in appearance tab iirc Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
DjPoke Posted November 19, 2024 Author Posted November 19, 2024 Hi Dreikblack, i've already tried to attach a cylinder but without success. I'll try a pivot and let you know. Quote
DjPoke Posted November 19, 2024 Author Posted November 19, 2024 I searched but not found how to add a pivot in Ultra Engine. I've commented "self.camera:SetFov(70)" but without success. Quote
Dreikblack Posted November 19, 2024 Posted November 19, 2024 I meant by pivot an Empty, in Misc because it is a name in code/engine After attaching a controller to it you can change a fov in line "self.camera:SetFov(70)" to needed value. Or add to FirstPersonControls.json a fov value like that: { "component": { "properties": [ { "name": "mousesmoothing", "label": "Mouse smoothing", "value": 0.0 }, { "name": "mouselookspeed", "label": "Look speed", "value": 1.0 }, { "name": "movespeed", "label": "Move speed", "value": 4.0 }, { "name": "fov", "label": "FOV", "value": 70 } ] } } And in FirstPersonControls.lua add "fov = 70" to other value at top and then change ""self.camera:SetFov(70)" to "self.camera:SetFov(self.fov)" With you will be able to change a fov as component variable in the Editor Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
DjPoke Posted November 19, 2024 Author Posted November 19, 2024 Is there an example somewhere i can use to compare ? Quote
Dreikblack Posted November 19, 2024 Posted November 19, 2024 Made updateFov() because Start() is called with adding a component automatically. Example use in main lua: -- Get display list local displays = GetDisplays() -- Create a window local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_TITLEBAR | WINDOW_CENTER) -- Create framebuffer local framebuffer = CreateFramebuffer(window) -- Create world local world = CreateWorld() -- Create light local light = CreateDirectionalLight(world) light:SetColor(2) light:SetRotation(45, 35, 0) -- Create ground local ground = CreateBox(world, 10, 1, 10) ground:SetPosition(0, -0.5, 0) ground:SetColor(0,1,0) local box = CreateBox(world, 1, 1, 1) box:SetPosition(0, 0.5, 1) box:SetColor(1,1,0) -- Create model local model = CreateCylinder(world, 1, 1, 5) model:SetPosition(0, 3, 0) model:SetRenderLayers(0) local fpsController = model:AddComponent(FirstPersonControls) fpsController.fov = 100 fpsController:updateFov() while window:Closed() == false and window:KeyHit(KEY_ESCAPE) == false do world:Update() world:Render(framebuffer) end FirstPersonControls.zip Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted November 19, 2024 Posted November 19, 2024 Damn, i just realized your question was about player size and not camera fov Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Solution Dreikblack Posted November 19, 2024 Solution Posted November 19, 2024 afaik player size params not added yet Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
Dreikblack Posted November 19, 2024 Posted November 19, 2024 Yes. In theory you can make a new controller with another physics or just resize it for now and wait for @Josh to add parameters for setting the player size. Quote Check out Slipgate Tactics demo, which is made with Ultra Engine: https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/
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.