Object (enemy) Jump?

Discussion in 'How Can I...?' started by Larry Pendleton, Aug 31, 2018.

  1. Larry Pendleton

    Larry Pendleton Boxer

    Joined:
    Aug 2, 2018
    Messages:
    58
    Likes Received:
    10
    Possible?

    My goal is to traverse an enemy back and forth on his run animation, and at a certain point, jump.

    Thanks
     
  2. Larry Pendleton

    Larry Pendleton Boxer

    Joined:
    Aug 2, 2018
    Messages:
    58
    Likes Received:
    10
    Also, I should have posted my current setup:
    1. The enemy object is moving back and forth on 2 Transforms
    2. The enemy object has an Advanced Move component
      • Animations = jump frames
      • Linear Velocity = 10 on "y"
      • Math Operate = Replace
      • Event = Collision
    3. Between the 2 Transforms, I have a a box as a platform, fixed, collide, no destroy
    So the enemy hits the box and does nothing but the transform logic, not sure whats wrong with my setup.

    Thanks
     
  3. Larry Pendleton

    Larry Pendleton Boxer

    Joined:
    Aug 2, 2018
    Messages:
    58
    Likes Received:
    10
    Big thanks to La-fey on Discord!
    • Set enemy as a physics object
    • Set friction to world settings to 0
    • Connect a Transform below your player that will make contact with the enemy when passing by, set its setting to give the enemy a vertical lift in the Linear settings
    • scale a long, thin transform across the scene with your enemy, above the enemy, high enough to make contact with the player, and set it's settings to move the enemy back down, so that it simulates the enemy falling off of the jump
    Your enemy must make contact with the connected transform to the player to jump, and then when its height reaches the long thin transform scaled across, will fall back down.

    Hope this helps someone out.

    -Raiden
     
  4. AppNasty

    AppNasty Miniboss Boxer

    Joined:
    Apr 14, 2016
    Messages:
    1,485
    Likes Received:
    890
    drop a transform logic in scene and set it to affect enemy. Make enemy a PHYSICS object. As he runs into the transform logic, if you set linear movement to make him go UP, he will ump and come back down. Place as many transforms as needed to gain the desired look and affect.
     

Share This Page