My current Project, lots of added features and changes

My current Project Boost so far, tweaks with gravity, added health and an fuel gauges, damage, as well as ability to gain fuel when touching things tagged with Fuel, and currently you also lose fuel when pressing thrust. Still need to add life gain(simple, same as fuel gain, just didnt add anything yet to gain life).

Sorry for the small gif, video changed a lot after conversion :joy:
ezgif-7-21cf6eadff76

I just need to figure out how to make it so the ship receives damage when colliding with terrain, but also so you can safely land on the terrain if the ship is upright, as it is on the landing pad. Hopefully will figure that out soon.

2 Likes

You got this! Everything is looking good so far!

Thanks man, been workin at it day in and day out. Working on the platformer mechanics part of the game now, been up all night building the character controller and trying to get animations right for the player, and because its 3D, yet, still a platformer, had to figure out how to restrict all kinds of movement, and limit to only character running left or right on a single plane, and character changing what way he is facing depending which direction you are running left or right. Also adding jump and physics and gravity lol. Been one heck of a ride. Learned a LOT about animations and making a character an everything over night, and still dont have my jumping quite right lol. I cant wait to put all of this together.

Looking great, here’s a way you could do the landing and damage:

  • Create an object and set it as a child of the ship.
    • Set that object’s position near the bottom of your ship.
  • Create a script that looks for terrain in that child’s position. (Physics.Whatever you like, I recommend a sphere cast).
  • If script detects ground it means the ship is at a decent rotation and correct position to land.
  • Check the speed of the ship, if the ship is going too fast then make it take damage.
    • I would check the ship’s speed by adding all the velocity’s values (It’s a vector 3 so I would add X, Y and Z values to give me an overall speed) and then compare to a threshold, like if the overall speed is less or more than the threshold value make the ship take damage.
  • To avoid taking damage multiple times I would make the ship “bounce” in the oposite direction of where it crashed and add some invulnerability frames, just enough so the ship won’t take damage multiple times during the same frame.

You could also do a raycast instead of using a child, but a child allows for a more flexible approach, this means you could use the exact same script with different types of ships.

As for the platforming part, don’t overcomplicate things, keep it as simple as possible and treat it as it were 2D, if you start messing with the Z value you’ll end up with really weird behavior, just lock the Z value in the Rigidbody, that’s all you need.

Hey Thanks! :smiley: I actually already have most of that sorted out, including the adding a object near the bottom of the ship haha, funny you mention that stuff cause I thought a lot of the same things. I will be adding the bounce for sure on contact taking dmg, and also, the platforming controls and basic character controller code are pretty much set, was up all night workin on it lol. Nah, im not gonna uze Z, nor was I planning on using Z. I have the character moving left and right only when using horizontal axis, vertical axis does nothing(yet, will use for ladders, maybe entering background/foreground doorways, not sure yet, might stick to left/right). Also, im not actually using rigidbody component to control my character, im using the character controller component.

My character’s nearly ready, just need to make the jump animation still, and at some point will need shooting animations and climbing animations and all that but for now, I have him walking left/right and changing directions on button press left/right and the walking/running/idle animations are set, along with basic controls. What I need to do, is add the code to make it, when ship is landed upright, I can press a button and landing gears will come out or something, and the player then comes out of the ship, camera zooms in, and now you are in walking(platformer) mode.

Walk around, do your stuff, explore, collect stuff, go back to ship, press a button, then camera zooms back out and resumes gameplay in shipmode. Thats my current goal :slight_smile: :smiley:

Privacy & Terms