Jump to content
Alex88

Make a playground from primitives as "one big object"

Recommended Posts

Hello together, is it possible to make a playground from primitives in just "one big object"? I have created a prefab and attached a lua script to rotate the playground, but unfortunately it only rotate one box. huh.png

 

post-7920-0-68457200-1390055194_thumb.jpg

 

post-7920-0-59737200-1390055464_thumb.jpg

Link to post

It should work if you make all objects you want to group together, to have a parent object.

So, for example, say you have an object called 'Box1', and another called 'Box2', then simply drag 'Box2' onto 'Box1' ( in the 'Scene' tab) to make it a child of 'Box1'.

 

Hope that helps?

Link to post

I confirm the bug.

Created a pivot , putting boxes as child and attaching a script to the pivot doing that :

 

function Script:UpdatePhysics()
local window=Window:GetCurrent()

if (window:KeyDown(Key.V)) then
self.rot = self.rot + 1
self.entity:PhysicsSetRotation(0,self.rot,0.02,0.5)
--self.entity:SetRotation(self.rot,self.rot,0.02,true)
self.entity:SetColor(0,0,1)
end

end

 

unsing entity:PhysicsSetRotation : LE 3.0 crash

using entity:SetRotation nothing happens

 

Could it be a pivot or a cube as parent , it should work in both cases.

 

-------------

 

@Alex88 :

it can be frustrating to not be able to do such simple stuff using BSP, but i recommend you to simply use models instead using BLender or Sketchup programs for example.

Link to post

Make an empty script call it : nocollapse.lua (doesn't need to have any code in it)

 

Add the script to box2,3,4,5

 

They shouldn't collapse on run anymore and respect the parent rotation and position.

So if you rotate the parent, they should follow.

Link to post

Is the script attached to your parent box , not to a child ?

 

Try saving your cubes group as a prefab and attach script to that prefab.

 

This is exactly what I have done already. wink.png

 

 

create a pivot as parent. all boxes are childs. rotate the pivot

 

(cant test it right now but seems legit)

 

If I attached my lua script to the pivot, nothing rotates. Here is my lua script:

 

function Script:UpdateWorld()
self.entity:Turn(1 * Time:GetSpeed(), 0, 0, true)
end

 

 

I confirm the bug.

 

...

 

@Alex88 :

it can be frustrating to not be able to do such simple stuff using BSP, but i recommend you to simply use models instead using BLender or Sketchup programs for example.

 

Hehe, you are absolutely right. It is frustrating to not be able to do such a simple stuff. wink.png

 

So did I found a bug in Leadwerks? huh.png

 

Why not just make the ground in blender and import it?

 

Because I was too lazy for the UV mapping. biggrin.png

 

 

Make an empty script call it : nocollapse.lua (doesn't need to have any code in it)

 

Add the script to box2,3,4,5

 

They shouldn't collapse on run anymore and respect the parent rotation and position.

So if you rotate the parent, they should follow.

 

This really works! I don't know why, but it works! ohmy.png Can you explain it to me?

Link to post

Classic, but missing boolean BSP "MERGE" should do this easyly without any empty script tedious tasks.

Well just wait for some "cut" and "merge" BSP tools.

Link to post

I believe it's an optimization thing so it may not make sense directly, but to speed things up I think it may be needed. If CSG doesn't have a script attached to it then it's really dummy geometry that has no function but collision/visual. That's the idea anyway.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...