Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Making a sledding game what should I do for the questions below?

Discussion in 'Getting Started' started by TobiasjBurford, Jan 3, 2023.

  1. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    I'm making a sledding game in Unity, I've got the generation working, but I have a couple of questions:

    1. What would be better, the stage moving or the player moving?​

    The player jumps which is basically all the player does
    and then the world moves to the X position.​

    2. Would it be better to turn gameObjects off or store them in a list when they are off of the screen?

    I'm thinking performance wise because my laptop (what i'm running Unity on)
    is on fire trying to run the program,
    at the moment i'm turning them off and storing them in a list.​
    3. How would I make the players rotation not go crazy if it hits something?
    When I jump I can go pretty high in the air and then if it hits something it spirals out of control.​

    4. How do I keep the player to the ground?
    I've got a non-friction material on all of my players colliders,
    I have amped up the gravity on the players rigidbody2D,
    but the player gets lots of airtime when going down a hill.
    I want something like "Alto's Adventure" if you've seen that game
    Thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    If the stage is simple and the player is simple, it doesn't matter.

    If you want to use actual physics on the player, well, he has to be the one moving.

    Physics can be quite tricky to stabilize in the general sense. One method is to have an invisible proxy physics object like a circle / sphere that rolls down the hill, then your visible sled merely copies its position each frame, while maintaining its rotation however you want, such as to the slope of the underlying ground, or tilt fore/aft according to player control.

    You can raycast and force the object to the ground, but all of these choices of fiddling with the physics will need to be experimented with because they will fundamentally change the feel, and only YOU know what you want.

    This is the last thing you should be thinking about. Go make the game.
     
  3. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    Regarding the performance, that depends on what platform you're building for such as PC, Android/Iphone, consoles (PS, Xbox etc) or whatever.
     
  4. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    The stage is like alto so it is just a bunch of slopes and straights put together to create a path of certain length

    Doing this instead of a circle it could be another sled that is Raycasted down to the ground like:
    I was just thinking this because you could fry an egg on my laptop where the fans are, and it sounds like a jet is leaving the runway o_O
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    LOL, fair enough. I just didn't want you to get tangled in optimizing and lose sight of the fun!

    Winter is only so long so you wanna get your sled action going before things start to thaw out!!
     
  6. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    Aha it is summer here, my idea is to like to have someone travel over a generated country that has desert, ice and so on.

    There is still fun but the polygon colliders and the images are making things not so fun, I made the track parts on illustrator and exported as a PNG but they are pixelated and then the polygon collider isn't smooth so the player like jerks around a bit :mad:
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    When working with pixel art it is common to hand-make smoother colliders, possibly even a bunch of circles all overlapping each other to make a nice smoothish surface.
     
  8. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    I'm trying to make them Vector art, not pixel art. I thought that PNG was Vector. If it isn't how would I get it to be Vector?
     
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    PNG files are raster (pixels). SVG files are vector (points, curves, lines).

    Unity's SVG / Vector package imports SVG files and "strikes" them to be raster at a particular resolution.

    When I want pure vector art (actual geometry instead of pixels), I import my SVG files into Blender3D and flip them around so they're in the direction and facing I want, then save them off and let Unity import that.
     
  10. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    I did try and get the SVG Importer HERE, but that didn't work, I'll try the Blender importing and see if that works! :)
     
  11. TobiasjBurford

    TobiasjBurford

    Joined:
    Feb 17, 2022
    Posts:
    11
    I tried doing the SVG by importing it into a blender, but when I added a mesh collider nothing collided with it, I put convex and the collider can be seen. Still, nothing is colliding with it?