- Home /
How to add force like a "kick" relative to swipe angle? (Skate game)
Hi,
I like to think how actual games works and then i'm trying to reproduce the True Skate (https://play.google.com/store/apps/details?id=com.trueaxis.trueskate) logic to kick the skate and do the tricks. My first idea to keep the physics real was to raycast a point in the skate, instantiate a ball with rigidbody in that point and add force to the transform.up * -1 of the ground. In the first idea the problem is that to perform a trick in skate and make the skate jump, you have to add some force forward and release the backwards force, like this:
So then, i add a Destroy() function to simulate the "release" and the second click will be a down + forward force, but the skate still doesn't act like the gif and this "solution" will only give me touches, and not swipe with angles and forces. (Plus i add some physic materials to ground and skate to test if the bounciness can help). Then after some research i found this question and tried to add the resultant force to the instantiated ball, with a slightly better result, but not what i wanted or even an acceptable result, if someone have a idea to implement this or experience with this "type" of physics it would be awesome. Thanks in advance.
Answer by lordlycastle · Mar 28, 2015 at 09:15 AM
Don’t know much about Skateboard tricks but what’s happening get gif is simple, first upward force is applied, and torque is applied. Both of with can be simple applied to rigid bodies with AddForce
and AddTorque
.
Thanks for the answer! But the idea to add the forces is simple, the question was how to simulate / get this force and angle from a swipe (like in the game True Skate) so you can combine a lot of movements dynamically, like for example in this video.
@nohabloinglez I don’t think all that is done with force. I think, there the animations are started with different type of swipes. The whole flip is pre-recorded animation, and simple started when someone swipes.
Your answer
![](https://koobas.hobune.stream/wayback/20220613191431im_/https://answers.unity.com/themes/thub/images/avi.jpg)