DjPoke Posted November 19 Share Posted November 19 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 Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 FirstPersonControls seems to overwrite fov value. Try to comment "self.camera:SetFov(70)" line in FirstPersonControls.lua Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 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 Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 Hi Dreikblack, i've already tried to attach a cylinder but without success. I'll try a pivot and let you know. Quote Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 I searched but not found how to add a pivot in Ultra Engine. I've commented "self.camera:SetFov(70)" but without success. Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 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 Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 Nop, I can't get it to works. Quote Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 Is there an example somewhere i can use to compare ? Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 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 Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 Damn, i just realized your question was about player size and not camera fov Quote Link to comment Share on other sites More sharing options...
Solution Dreikblack Posted November 19 Solution Share Posted November 19 afaik player size params not added yet Quote Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 So, i have to resize my map ? Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted November 19 Share Posted November 19 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 Link to comment Share on other sites More sharing options...
DjPoke Posted November 19 Author Share Posted November 19 Ok, thank you Dreikblack ! 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.