Can anyone please help me as to why is my actor sticking to the wall instead of bouncing? :(
dipenambalia
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
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
This, or use the the Change Velocity behavior with a direction of random(0,359).
Mental Donkey Games
Website - Facebook - Twitter
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.
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]
Thanks a billion folks! changing from move to linearvelocities solved my problem!!!