Does anyone know how to measure the distance between two objects so I could create a planet and have something pulled towards the planet faster the closer it gets?
Using magnitude. There's a really nice template made by firemaplegames, if I remember well, that's pretty easy to understand and should just be what you're searching for.
This demo doesn't accelerate faster based on proximity, but it could be modified to do so. It does demonstrate how to trigger movement when an object gets closer.
barkbark00 said: This demo doesn't accelerate faster based on proximity, but it could be modified to do so. It does demonstrate how to trigger movement when an object gets closer.
Hachiko said: Using magnitude. There's a really nice template made by firemaplegames, if I remember well, that's pretty easy to understand and should just be what you're searching for.
So does anyone know how I would find the magnitude? I'm in high school math so can you explain it in detail?
Comments
http://gamesalad.com/game/play/67052
Then when an object collides with the invisible actor, it makes the actort move towards the invisible actor's centre (and thus, the planet).
I use it for black holes
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
`magnitude( self.Position.X - game.VicX , self.Position.Y - game.VicY )`
The above expression gives you the distance between the star's position and that of the planet which is constrained to "VicX" and "VicY"