Can anyone please help me as to why is my actor sticking to the wall instead of bouncing? :(

dipenambaliadipenambalia Member, PRO Posts: 12

Can anyone please help me as to why is my actor sticking to the wall instead of bouncing? :( why doesnt the actor A just bounce??? what am i doing wrong? shouldnt just using the bounce behaviour solve my problem???

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You're moving the block with a Move Behavior. Instead of that use two Change Attributes and change the Motion.Linear.Velocity X and Y to random numbers and I think you'll get the effect you want.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @jamie_c said:
    You're moving the block with a Move Behavior. Instead of that use two Change Attributes and change the Motion.Linear.Velocity X and Y to random numbers and I think you'll get the effect you want.

    This, or use the the Change Velocity behavior with a direction of random(0,359).

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2016

    @jamie_c said:
    You're moving the block with a Move Behavior. Instead of that use two Change Attributes and change the Motion.Linear.Velocity X and Y to random numbers and I think you'll get the effect you want.

    It'd probably be easier for him to just use the Change Velocity behaviour with a random angle.

    EDIT: whoops, missed MentalDonkey's post ! Basically what he said.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2016

    @MentalDonkeyGames said:

    @jamie_c said:
    You're moving the block with a Move Behavior. Instead of that use two Change Attributes and change the Motion.Linear.Velocity X and Y to random numbers and I think you'll get the effect you want.

    This, or use the the Change Velocity behavior with a direction of random(0,359).

    I always feel that random 0-359 is wrong as it misses out the angles between 359 and 360, but of course 'random' returns only whole numbers so I'm wrong in that all whole number angles are (can) be returned with 0-359, which leads me to think that there's no good reason to limit random angles to whole values, so for a truley random angle something like 'random(0,3599999)/10000' might be better.

    Imagine this scenario, you are shooting a bullet from a fixed position, from the left of your (iPad Retina Lanscape), at random angles, If those angles are limited to whole numbers the difference between a bullet shot at 21° and 22° - when it hits the far right side of the screen - is around 41 pixels (41 Retina pixels / 20.5 GS project pixels), using whole number values for the angle means a bullet cannot end up in the 41 pixel gap between 21° and 22°.

    Hope than makes sense !

    [/PointlessAnglePedantry]

  • dipenambaliadipenambalia Member, PRO Posts: 12

    Thanks a billion folks! changing from move to linearvelocities solved my problem!!! :) :) :)

Sign In or Register to comment.