Jump to content

Recommended Posts

Posted

Hello there. Im making a PVP game and I have made a moon in the game for PVP purposes.  The only catch is that when you go towards the side of the planet. you fall off of it.

Is there anyway to generate gravity in a model of the moon?

Thanks for any help you can provide,

Robert

Posted

Yes, you would need to use regular rigid body for characters instead of character controller. But then you run into different laggy behaviors with movement. Really unfortunate but current character controller is very limiting.

Posted
On 12/11/2020 at 2:29 AM, Robert_d1968 said:

Hello there. Im making a PVP game and I have made a moon in the game for PVP purposes.  The only catch is that when you go towards the side of the planet. you fall off of it.

Is there anyway to generate gravity in a model of the moon?

Thanks for any help you can provide,

Robert

I don't understand this. Gravity would point towards the center of the planet, so how can you fall off it?

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

I made a sphere for a moon and when you walk to the side. the character falls towards the ground and hits the land mass below.

The moon has no gravity so the character just falls off of it when the sides come up.

Robert

Posted

Ah, I see, that is what you want to avoid.

You could rotate the moon so it is always below the player.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

Thanks for the idea. I will try that one out.

Robert

PS I do however foresee a problem with that, as it will be a multi player game and rotating the planet may put other players on the side of the moon.

That may make them fall off the moon also.  But it will be something I will try out.

  • 4 weeks later...
Posted

The old Windows Game Programming for Dummies came with a demo disk. On it was a 2d game with planets where you'd fire things and they had gravity behaving the way you're describing. Unfortunately, the game was named something that's also a popular name for other games. Of which I forgot the exact name of. I believe it was "Deadlock", even though that's also a 4x game that I happen to have played as well.

If anyone can find that game, you might have a lead on the type of math you need. Of course, it's just math, and if you can recreate a gravity equation, which I believe is the same as the magnet equation, (Force in relation to distance, something squared, blah) or just fake it by creating a fall-off distance where the force is greatly reduced after N units or something, you should be good.

Long story short, your problem is a math problem and you may be forced to dive into trig at the easiest, calc otherwise, and there's no getting around. Find someone who can do the equations if you can't, or go watch the tuts on game math throughout the internet. I admittedly only have surface knowledge of linear alg and whatever calc from HS.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...