Every step and location
9 posts • Page 1 of 1
Every step and location
Hi there. I'm wondering, are there ways to:
1: Have a "step" event, so that literally every frame of Algodoo running, an action can be commited (or an event checked?) In other words, a way to "always" be checking for whatever input?
2: Track an object's location (x,y,z)? I need to be able to use an object's location as a variable for other objects to use as inputs for whatever value, (density, length, etc.)
Thanks!
1: Have a "step" event, so that literally every frame of Algodoo running, an action can be commited (or an event checked?) In other words, a way to "always" be checking for whatever input?
2: Track an object's location (x,y,z)? I need to be able to use an object's location as a variable for other objects to use as inputs for whatever value, (density, length, etc.)
Thanks!
- dsengere
- Posts: 12
- Joined: Thu Oct 22, 2009 5:49 pm
Re: Every step and location
You would need to use a beacon. Follow the tutorial and it will turn out great.
To constantly get the location of an object you would need add a beacon near the center of the object and in the onCollide write:
e.pos(0) = X axis
e.pos(1) = Y axis
To constantly get the location of an object you would need add a beacon near the center of the object and in the onCollide write:
- Code: Select all
Scene.my.pos = e.pos
e.pos(0) = X axis
e.pos(1) = Y axis
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Every step and location
I'm sorry but I'm having some major problems. Does the beacon include the circle, or is the circle that you had in your beacon post the actual object where I put the "step" text? BTW I really hate this stupid coding method.
Thanks for your help
Thanks for your help
- dsengere
- Posts: 12
- Joined: Thu Oct 22, 2009 5:49 pm
Re: Every step and location
Yes, the circle is the easiest place to put the script. What don't you like about the coding method?
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Every step and location
Ahhhh. Thank you very much. My only problem now is that scene.my.pos(0) and scene.my.pos(1) aren't updating. Do you know how to fix this?
By the way thanks so much for your time. You are quite helpful.
By the way thanks so much for your time. You are quite helpful.
- dsengere
- Posts: 12
- Joined: Thu Oct 22, 2009 5:49 pm
Re: Every step and location
Did you put Scene.my.pos = e.pos in the script? Also, are you using Algodoo or Phun? In both applications a beacon is the fastest updater possible. In Algodoo you could just point the laser where you want and use Scene.my.pos = e.pos instead of a beacon.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Every step and location
Alright. I'm using Algodoo. In the most "algodoo-for-dummies" method possible, can you explain to me the steps of how to use a laser to extract an object's (a rolling ball) X and Y coordinates and turn them into variables which I can have an object draw?
Thank you sir.
Thank you sir.
- dsengere
- Posts: 12
- Joined: Thu Oct 22, 2009 5:49 pm
Re: Every step and location
Never mind, I got it. Thanks dude!
- dsengere
- Posts: 12
- Joined: Thu Oct 22, 2009 5:49 pm
Re: Every step and location
You're welcome! I love it when people find out the answers to things immediately.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
9 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests