Projectile motion in creator with physics manager functions

Hi i want to create parabolic movement of object by hitting that object with some rigidbody.
I tried actions(cc.jumpTo but i need physics base) in creators but what about physics way?

i used
this.getComponent(cc.RigidBody).applyForceToCenter(new cc.Vec2(-10500, 49500), true);

but it sometimes work. need your help.

If you want to make a parabola effect, you can use cc.bezierTo() or cc.bezierBy()
https://docs.cocos.com/creator/manual/en/scripting/action-list.html

2 Likes

that action causes huge ball jerks though fps seems ok to me :frowning: .
I am unable to achieve better result. If you please help me :slight_smile:

on devices for instant games.

            var bezierTo = cc.jumpTo(2, cc.v2(60, -350),  200, 1);
            var rotateTo = cc.repeat(cc.rotateTo(1, -60), 4); 
            var seq = cc.spawn(bezierTo, rotateTo);
            this.node.runAction(seq);

on tap i do call above code but on another tap i stop last action first and then call again above code. which causes smooth on editor browser but on mobile hell of jerks in ball.

1 Like

Can you provide me with a demo to reproduce the question? The platform where the problem occurs is native? Or show me something unusual? GIF or video?

2 Likes

@zzf_Cocos thanks for your response. i share a demo with you in few minutes. problem occurs on facebook instant android device.

Well i do share with you

1 Like

Hi,
@zzf_Cocos
fb Instant game android
here is what want https://drive.google.com/file/d/1M0BV9-i4SxpJ2oJdiEwh6Nbu73M58UHB/view

script:
https://drive.google.com/file/d/10MVZuKQpcb53xyviFTe1iWWTHmEOTu5q/view

I achieved motion above but my ball feels jerks while it jumps from one hand to other.

Actually balls jumps from one hand to other side on ground. but if timely hands come then ball goes back to the other side on the ground. I am attaching my ball script as well. What you do think the problem is? i would grateful to you.

If anything more i can provide do let me know please :slight_smile:

1 Like