Search Unity

Simulated 3D, using pre-set splines or adding forces?

Discussion in 'Physics' started by arnhmail, May 18, 2018.

  1. arnhmail

    arnhmail

    Joined:
    Oct 14, 2017
    Posts:
    13
    Xposted from 2D, I think I posted this in the wrong forum:


    Hi everyone,

    I'm looking to do a few things in a simulated 2D game, with a fixed isometric perspective.

    I want to do two things,

    1. Jump the player in the direction of a key press. This would involve an arc that is in one of eight directions. I suppose these could be a pre-defined curves that are instantiated when the jump button is pressed, based on what movement button is pressed as well. This would enable jumping back to the left, back to the right, etc. This seems like an easy hack, and just to somehow use an animation following a curve, and then re-instantiate the player object when the animation is over.

    Or, I could add a force that's in the direction the player is already moving, plus an increasing and decaying height on the Z axis? This seems simple, are there any downsides here?

    2. Rotate an object around the player, with the behavior of a planet, i.e. getting the orbit to be longer or shorter depending on how the object being orbited moves. I have come across rotateAround, but I'm unsure if this is what I'm looking for, or if there's a way to do this with physics, or if I should stick to using pre-set animation curves here as well. In this case, the pre-set way seems incredible complex and tedious. Is there a way of orbiting and increasing/decreasing the attraction strength?

    Thanks a ton, and if my question isn't clear I'm happy to explain anything that didnt make sense!
     
  2. arnhmail

    arnhmail

    Joined:
    Oct 14, 2017
    Posts:
    13
  3. wizycatdesigns

    wizycatdesigns

    Joined:
    May 17, 2018
    Posts:
    7
    i think they have default options in standard assets and if they dont just use unity,s 2D asset pack its free