Another N00B needs some halp plz
8 posts • Page 1 of 1
Another N00B needs some halp plz
How would I go about making an OnCollide script where it slows down the sim speed?
-

Metagami - Posts: 25
- Joined: Sun Apr 11, 2010 4:36 am
Re: Another N00B needs some halp plz
And another thing, how do I write a script that rotates the camera?
THX for your help guys
THX for your help guys
-

Metagami - Posts: 25
- Joined: Sun Apr 11, 2010 4:36 am
Re: Another N00B needs some halp plz
for camera rotation you really could do it mechanically, no need for scripting
you could do follow with camera and track rotation
might i ask what you would do with that?
you could do follow with camera and track rotation
might i ask what you would do with that?
BTC: 12wcLxBejr6rhCk6WPyVSNmkjwwbxXEvBG
LTC: LQ17UdL71xzLCprSfkoWUQXDXWuHjx2nf9
FTC: 6nfbPuFbtk8uNokYSsVfbzc5393ggxNGDC
polygons > textures
STUFFES:
http://www.algodoo.com/algobox/profile.php?id=4540
LTC: LQ17UdL71xzLCprSfkoWUQXDXWuHjx2nf9
FTC: 6nfbPuFbtk8uNokYSsVfbzc5393ggxNGDC
polygons > textures
STUFFES:
http://www.algodoo.com/algobox/profile.php?id=4540
-

sheepborg - Posts: 203
- Joined: Sat Dec 05, 2009 10:44 pm
- Location: North Carolina USA
Re: Another N00B needs some halp plz
sim.timefactor is the variable that you want.
Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
-

RicH - [Funniest Person 2010]
- Posts: 2043
- Joined: Tue Sep 01, 2009 9:01 am
Re: Another N00B needs some halp plz
Thanks for the first one, and I already have a ball on camera follow, so I can't have a turning ball on follow rotation also or else it won't fallow the ball.
I'm making a ball that activates slow-motion when it hits a ramp, and also tilts gravity(already have the script for that) and camera angle when it hits a wall.
Thanks for your help!
I'm making a ball that activates slow-motion when it hits a ramp, and also tilts gravity(already have the script for that) and camera angle when it hits a wall.
Thanks for your help!
-

Metagami - Posts: 25
- Joined: Sun Apr 11, 2010 4:36 am
Re: Another N00B needs some halp plz
You could always put a box that has a weight on the bottom onto the circle, and make that box and weight invisible and unable to collide with anything. Then make the camera follow the box and track rotation. When the gravity switches, it'll turn the box (using the weight) and rotate the camera.
I'll upload an example if you don't understand.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Another N00B needs some halp plz
Yes, but Chronos, that can only work so well.
I think he's trying to make something similar to a couple flash games I have seen. Here's the gist of gameplay:
You control a ball. You can move and maybe jump the sphere. When you are flying through the air, time slows down. When you hit a wall, gravity changes so that that wall is now the floor.
You navigate your way through puzzles and avoid obstacles. There might be enemies.
If you had a free swinging weight attached to the ball, it would not be as smooth as this guy needs it to be.
What you need to do is create a box or something, and make it's rotational velocity thing +inf. Then, attach your ball to that object with a hinge. This hinge controls movement, so make it a motor.
For slow motion through the air, you could either do it with colliders on the ramps, or with a collider on the ball. I suggest the latter. The collider on the ball should check and see if the ball is touching anything, and if it is set sim.timefactor to normal, and if not set it to less. This way, any time you are in the air time will slow down. And it is less work than adding colliders to all the ramps and stuff.
For wall collide gravity switch, you can either set a collide on the wall so every time something hits it gravity changes to whatever angle it is at (which won't work if you have rounded edges, like a large ball), or you could do some mechanical stuff on the ball that would track the angle of the "ground" under you and set camera rotation tracking and gravity tracking. This is the best option by far.
I'll see if I can mock it up. Hope that helps!
I think he's trying to make something similar to a couple flash games I have seen. Here's the gist of gameplay:
You control a ball. You can move and maybe jump the sphere. When you are flying through the air, time slows down. When you hit a wall, gravity changes so that that wall is now the floor.
You navigate your way through puzzles and avoid obstacles. There might be enemies.
If you had a free swinging weight attached to the ball, it would not be as smooth as this guy needs it to be.
What you need to do is create a box or something, and make it's rotational velocity thing +inf. Then, attach your ball to that object with a hinge. This hinge controls movement, so make it a motor.
For slow motion through the air, you could either do it with colliders on the ramps, or with a collider on the ball. I suggest the latter. The collider on the ball should check and see if the ball is touching anything, and if it is set sim.timefactor to normal, and if not set it to less. This way, any time you are in the air time will slow down. And it is less work than adding colliders to all the ramps and stuff.
For wall collide gravity switch, you can either set a collide on the wall so every time something hits it gravity changes to whatever angle it is at (which won't work if you have rounded edges, like a large ball), or you could do some mechanical stuff on the ball that would track the angle of the "ground" under you and set camera rotation tracking and gravity tracking. This is the best option by far.
I'll see if I can mock it up. Hope that helps!
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.

a Mammoth wrote:be boring and interesting.
I didn't know you could go up 3.1.3! Thanks Mystery person!Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
-

Dakta - Posts: 417
- Joined: Sat Sep 12, 2009 4:36 pm
Re: Another N00B needs some halp plz
Okay, the slow-motion and gravity switch work great, and it turns out I don't need any of that fancy stuff.
I was looking at a normal script page; I noticed all camera scripts start with scene.camera. and the gravity is rotated by increments of pi, so for the upside-down plane, I tried:
Thanks for all the help anyways!
I was looking at a normal script page; I noticed all camera scripts start with scene.camera. and the gravity is rotated by increments of pi, so for the upside-down plane, I tried:
- Code: Select all
(e)=>{scene.camera.rotation = 3.14159 }
Thanks for all the help anyways!
-

Metagami - Posts: 25
- Joined: Sun Apr 11, 2010 4:36 am
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests



