Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 1]
Member [Lv. 1]
Posts : 2
Points : 780
Rep : 0
Join date : 2016-06-07
View user profile

Need some help on Rocket League-esk game (Cannot figure out aerodynamics/boosts/keeping momentum while jumping)

on Tue Jun 07, 2016 9:03 am

So as you can see this is my mini game project so far. Whenever the car jumps it just goes straight up and doesn't keep the same speed/momentum.

(Just another picture)
Here is my source.
Code:
using UnityEngine;
using System.Collections;


public class Jump : MonoBehaviour
{
    public Rigidbody truck;

    void Start()
    {
        truck = GetComponent<Rigidbody>();
    }
    void FixedUpdate()
    {
        if (Input.GetKeyDown(KeyCode.B))
        {
            truck = GetComponent<Rigidbody>();
            truck.velocity = new Vector3(0, 7, 0);
        }
        else if (Input.GetKeyDown(KeyCode.LeftControl)) {
            truck.velocity = new Vector3(0, 3, 4);
             }
    }

        }

Let me know if there is something I am missing. I am on 5.3.5f1,
Edit: I was able to fix the inertia/momentum flaw using this to set only the y axis to a different value.
Code:
rigidbody.velocity = new Vector3 (rigidbody.velocity.x, 10f, rigidbody.velocity.z);


Last edited by SantaClause on Tue Jun 07, 2016 10:02 am; edited 1 time in total (Reason for editing : Found fix.)
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 54
Points : 1910
Rep : -7
Join date : 2014-01-28
View user profile

Re: Need some help on Rocket League-esk game (Cannot figure out aerodynamics/boosts/keeping momentum while jumping)

on Mon Aug 08, 2016 10:34 am
Message reputation : 0% (1 vote)
Hello

We see that you have some issues with your project/script, however we can help you for a price. If you would like us to work for you then please feel free to contact us at http://RenntekStudios.co.uk or on Skype at RenntekStudios thanks

Our prices are very cheap. Little errors we can fix for free, otherwise projects we can discuss prices. Hope you get in touch shortly thank you...
Back to top
Permissions in this forum:
You cannot reply to topics in this forum