Help with your scripting

Disabling gravity with Simple Character controller

Disabling gravity with Simple Character controller

Postby howler » 16 May 2014, 12:58

Just as a quick test I've created a cube in a blank scene and assigned the simple character controller to it. I've tried adding the following line to the onInit code block
Code: Select all
controller.enableGravity(obj,0);

I've also tried assigning it "1" rather than "0".

I've also set the GravityY value as follows
Code: Select all
controller.setData_gravityY(0);


Neither stop the cube falling to the ground plane.

It looks like a bug to me as even though the function's undocumented it seems it should be straightforward. I wanted to get the community's opinion though before posting it as a bug. Thoughts?
User avatar
howler
Skyline Ensen
 
Posts: 110
Joined: 10 Apr 2014, 23:50
Location: Sydney, Australia

Re: Disabling gravity with Simple Character controller

Postby SolarPortal » 16 May 2014, 13:39

have you tried using the character.function() library?
i believe the controller functions are for spawned kinematic controllers.
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Disabling gravity with Simple Character controller

Postby howler » 16 May 2014, 13:54

At this point I have no idea what a spawned kinematic controller is but I'm assuming I've created one and the enableGravity/setData_gravityY functions don't do what I thought they would for some related reason :D .
From a quick bit of testing it looks like I can't combine it with a character.setGravity function either.

I'll try recreating the simple character controller from scratch using the character library and see how I go.

Cheers!
User avatar
howler
Skyline Ensen
 
Posts: 110
Joined: 10 Apr 2014, 23:50
Location: Sydney, Australia

Re: Disabling gravity with Simple Character controller

Postby SolarPortal » 16 May 2014, 14:04

if you have used an action for the SCC, then you can only use the character library instead of the controller library.
We made them separate because the SCC is a character controller only and used the character library, where as the controller will be improved to create other movable physics such as elevators, platforms that move etc...

to use controller library, you have to spawn a body in lua, this would have no action apart from microscript.
See tech demo: Tech Demos\Character\Spawned Lua Character\Spawned Lua Character.xSkyScene

For simple character controller: see the example script in the action's microscript properties when you attach the action.
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Disabling gravity with Simple Character controller

Postby howler » 16 May 2014, 14:16

No problem, thanks for the info!!!
User avatar
howler
Skyline Ensen
 
Posts: 110
Joined: 10 Apr 2014, 23:50
Location: Sydney, Australia

Re: Disabling gravity with Simple Character controller

Postby SolarPortal » 16 May 2014, 14:17

cool :D
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron