Jump to content

Questions about controllers and editor


Arska134
 Share

Recommended Posts

Hello again.

 

Here is some questions for you about controllers and editor:

1. How i can increase player controller height. Now it's tall as grass.

player=CreateController(8.8,0.45,0.25,45)

Tried to change values without luck and those values are from FPScontroller lua script.

 

2. Can i add my own models to Leadwerks editor? If yes, How? (i'am using evalution kit)

 

3. Can i add animated models with Leadwerks editor to scene?

 

Thanks for advance. :(

Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax

Link to comment
Share on other sites

1) this is the syntax for CreateController():

CreateController:TController( height:Float, radius:Float, stepheight:Float=0.5, maxslope:Float=45.0, crouchheight:Float=0 )

the first parameter sets the height... which you have set to 8.8 meters... which should be way higher than your grass... if not, its no longer grass but rather a dense tropical forest... the fpscontroller script sets the controller as 1.8 meters tall. Offhand i would guess that you are not setting the camera to the correct height but instead setting it to the position of the controller that puts it at the ground...

 

2) the evaluation kit comes with converters now located in the Tools folder. just drag your model file onto the appropriate converter executable

 

3) yes

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

If you parent the camera to the controller, it is parented at the bottom of the controller. So, no matter how tall your controller is, the camera will always be in the grass. Use the PositionEntity(camera); command to move it up on the Y axis. Your code should look something like this:

 

//Create the character controller
controller = CreateController();
PositionEntity(controller,Vec3(x,y,z));

// Get framework main camera
camera = GetLayerCamera( GetFrameworkLayer(0) );
EntityParent(camera,controller);

//Position Camera off the ground and behind the controller (for 3rd person)
PositionEntity(camera,Vec3(x,y,z));

 

Result is this: http://www.leadwerks.com/werkspace/page/videos/_/leadwerks-engine/my-first-demo-r105

 

Also, use the DebugPhysics(1); to show an outline of your player controller.

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