0 Favourites

# need help with complex drag / offset issue

• 7 posts
• Hi there,

I'm working on a box flicking game and have most of it working, but there is a tad bit of sloppiness that I would like to find a solution for.

this is what i have with C2 so far..

I made this in gamesalad and want to recreate it with C2 but you see how the boxes tend to be fluid and not so prone to freaking out if i move them slow sometimes...

The big issue is notice how in the C2 version (first link) when you move slowly.. see how it violently shimmies? I would like that to not happen either. would just like it to naturally flow like the youtube example does.

I'm hoping there is a way to calm the boxes down a little, but not be a cpu intensive solution.

Thanks!

Caleb

• what are you doing with the boxes when drag is on? are you changing angles? are you using drag and drop behavior? it like something is resetting the objects angle..

any modification that is not in the physics sense, can make physic-objects react irregular, but maybe just setting x and y to mouse could work

edit: its probably more a question of how are you setting the angle of the object, i think your youtube example is using a complete physic solution to drag the boxes, you could get the angle of motion, and try to turn the object in that direction with physics

• I've linked the project here if you want to see first hand, but in a nutshell, yea i'm doing a:

angle(box.X, Box.Y, touch.X, touch.Y)

the fling effect is achieved doing a:

physics impulse distance(box.X,box.Y,Touch.X,touch.Y)/2

so yea if I follow you correctly, I'm not using physics to set direction and don't know how to do that. Any suggestions? I tried things like Physics Force At Angle (not sure i'm using any of them right) but it didn't seem to yield any results.

• the problem is when you stop moving, the angle always return to 0, because there is no difference between box and touch coordinates

you will need some check to only set angle when you are actualy dragging the box

• Error snipe. Disregard. See below.