measure speed?
3 posts • Page 1 of 1
measure speed?
hi i wanna make a car with an speed-meter:
i wanna calculate it with lasers (prefer 1 but 2 is also good or more ) but does anyone know how to do this?
i wanna calculate it with lasers (prefer 1 but 2 is also good or more ) but does anyone know how to do this?
- jessebax129
- Posts: 34
- Joined: Tue Jan 05, 2010 6:32 pm
Re: measure speed?
declare one or two new variables to save specific position and time values. for example scene.my.time and scene.my.pos. in addition make a variable that saves your velocity values. for example scene.my.vel. then make a laser colliding with a box and in the onhitbylaser scripting line type in:
- Code: Select all
(e)=>{ scene.my.vel = (e.pos - scene.my.pos)/(sim.time - scene.my.time); scene.my.pos = e.pos; scene.my.time = sim.time }
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: measure speed?
jessebax129 wrote:hi i wanna make a car with an speed-meter:
i wanna calculate it with lasers (prefer 1 but 2 is also good or more ) but does anyone know how to do this?
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests