"Planet Gravity" to an object


I have returned to blender!! And my last question is this.

How to make a gravity to an object , looking like a “Planet Gravity”.

I’m making a game that looks like http://proun-game.com/ , see te video and if you can , tell me how to make that object gravity.

Again , thanks!

Answers pleaseeeeeeeee


Here’s what Ive been working on.

import bge
l = bge.logic
cont = l.getCurrentController()
own = cont.owner
sce = l.getCurrentScene()
alignVec = own.getVectTo(sce.objects['Planet'])[1]
own.alignAxisToVect(alignVec,2,1) #(alignmentVector,Axis,1 = instant alignment| 0.0 = none 0.5 = half speed turn to ☆0.85 is a nice value)
xSpd, ySpd, zSpd = own.getLinearVelocity(True)

http://www.weddingdressesselling.com/Bridesmaid dresses—whetherin politics, academia, or other Prom dresses uk areas—can be useful. They focus our attentionon Bridesmaid dresses in ways that no speaker or reformer ever could.—
When at the mention ofaaa, most people might be deeply impressed by the Clinton sex scandal occurred in the 1990s,which sparked a fierce debate about the powers and duties of legal prosecutorsin and out of office. Such Bridesmaid dresses indeed call our close attention to som

Doesn’t work :frowning: Any other solution?

Do you have the script I posted running on your player with an Always sensors with true pulse to a python controller? And in line 6 change sce.objects[‘Planet’] to sce.objects[‘your_Planet_objects_Name’]. And make sure your player object is dynamic physics or rigid body physics.

Yeah , It is now running , but I have created a logic brick for the player movement , but when I press the key (Up Arrow) it doesn’t moves. Any idea?

If you’re using a motion actuator and using Loc, try switching to the linV with a value of 10 on y. Or try adding

import events

under import bge. Then right above the last line try adding

UP = l.keyboard.events[bge.events.UPKEY]
if UP == 2 or UP == 3:
    ySpd = 15

1 = up arrow key tapped
2 = up arrow being held down
3 = up arrow was released from being held or pressed.

Thanks , I will try that.

PD: Where you learned python? I’m going tu study it. Without it , blender is really limited :stuck_out_tongue:

tutorialsforblender3d.com and on the blender.org site the python api reference helps alot. I completely agree, blender is very capable on its own but the ability to code in python eliminates having a large amount of logic bricks. If you need any more help just pm me or of course post here, Im also working on planetary gravity at the moment. I think Ive figured out multiple planets and different gravities and ranges.