How do I bounce item in 3d game??

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • for example when i use Foggy outbreak template, and when i destroy zombie and when he spawn items on level how i do to bounce them few times before items stand still ?

  • I would try to implement gravity on them.

    add an instance variable to the item you want to bounce called "vectorZ" (or something like that)

    add an instance variable to the item you want to bounce called "bounces" set it to something like 3 (or however many bounces you want)

    make a global variable called "Gravity" and set it to something under 0

    in your event sheet:

    for each {Bouncy Item}

    {Bouncy Item}.vectorZ - Gravity

    {Bouncy Item} Set Z elevation = self.ZElevation - self.vectorZ

    (Sub event) Compare two values ({Bouncy Item}.ZElevation <= 0)

    (Sub event) {Bouncy Item}.bounces > 0

    {Bouncy Item} Set Z elevation = 0

    {Bouncy Item} set vectorZ = 3

    {Bouncy Item}.bounces - 1

    else

    {Bouncy Item} Set Z elevation = 0

    This should make them bounce a couple times (I havent tested it.).

  • A very easy way to do it is to use the "Tween" behavior, as you can see in the last event I have added to the Foggy Outbreak template, which you can download here: fileport.io/8GgyJmSL62ya

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • A very easy way to do it is to use the "Tween" behavior, as you can see in the last event I have added to the Foggy Outbreak template, which you can download here: fileport.io/8GgyJmSL62ya

    Awsome :)

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)