Creating Runtime Curve Collider using Mouse

Hello,
I am trying to make a game like this Reference,

http://www.lorenzgames.com/game/way-of-an-idea

There is a game based on gravity where, i need to create run time collider for sphere using mouse so sphere can drop it on and react according to shape.

how can i achieve this in unity for 3d game same as this reference.

Plz help me in this.

2 Answers

2

Take whatever object you wanna drop and goto Component / Physics / Rigidbody. This will give it physics. Attach this simple script to it. This isn’t much, but it will get you started. This uses rigidbody.Sleep(); and rigidbody.WakeUp(); Input.GetMouseButtonDown(0) is simply left click. When you place the sphere or whatever your object is to drop in the air, it will stay there, but when you click, it will fall to the ground. In order for it to react to shapes of other objects, make sure the objects have a collider attached. Like for the sphere : Component / Physics / Sphere Collider. For a more complex shape, use a Mesh Collider, and check the “Convex” box in the inspector when the object is selected. Convex mesh colliders can collide with other mesh collider and terrain, as well as your sphere or box colliders.

function Start()

{

rigidbody.Sleep();

}

function Update()

{

if(Input.GetMouseButtonDown(0))

{

     rigidbody.WakeUp();

}

}

in this game i want create black board chaluk as object

I think lavpatel wants to draw with the chalk! It's kind of a difficult thing, especially when you are dealing with 3d space.

Thank You all for ur reply and support, But i m glad to tell you that we are able to get the thing done, what we wanted.

Thank again.