i've tried to make my model to be a car, but the previous models have an issue so i used a revised one, but in this one the wheel collider is very off, it's rotated 90 degrees instead of pointing downwards, any help for this? it's getting annoying!
here's a screenshot to clarify things up
[1]: /storage/temp/79380-bandicam-2016-10-02-21-00-54-739.jpg
↧
wheelcollider not aligned
↧
WheelCollider powered vehicle speed
I have a car and I'm trying to adjust values so it works like real ones.
As for now, with 600 torque my 2 tonn car accelerates up to supersonic speeds and beyond.
Is there a way to adjust friction curves so car won't be able to reach high speeds?
*I'm extremely sorry for by bad English. Its not my native language*
↧
↧
good setting for WheelCollider
Hi) I writing my script on js for my rally racing. І can't set normal setting and find normal setting for Wheel Colliders (Forward Friction and Sideways Friction).
if similar question has been, give me link.
Thanks)
Sorry, but my english very bad :(
↧
Simple arcade car Physics
Hello,
I am trying to make a simple, arcade-ish racing game. I wrote a script for the car using wheel colliders. The whole thing works fine, however I cannot get the desired behaviour.
First problem is that the wheels are spinning too much on acceleration. So, I increased the forward friction stiffness. The result is not that bad.
The second problem is the sideways slip. I want to have almost no slip. If I increase the sideways stiffness a lot, the car is impossible to drive because it oversteers when you turn, and therefore loose control. If I don't, the car slips too much, especially when high motor torque is applied. I want to be able to have high motor torque, and almost no sideways slip on hard turns.
What I am after is a car to behave somewhat like "Smashy Road: Wanted". Another good example would be this video: https://www.youtube.com/watch?v=41JLyWN4pfk&index=36&list=PL-53SQoWujdjGn0vTu5y6B0iCXuN2_P_g
Any tips on how to achieve this arcade driving style?
Thanks
↧
Wheel colliders act weird
Ive seen a lot of car tutorials for wheelcolliders, but mine act very strange!
The don't follow the object they are attached to probably, when i move my empty object with the collder, they follow with half the speed which makes them very hard to attach probably. And when i then play the game, the car starts moving slowly to in all directions.. Anyone know how i can fix this?
↧
↧
How do I make wheelcolliders act like a real car with under-steer and over-steer. it seems I can only have one and the over-steer is extremely unrealistic
Ok I have set up 4 wheel-colliders for my car with the power going to the back wheels. I am making an arcade-ish top down driving game and I want to have physics where I can hold a drift nicely and have minimal over-steer. The way I had it before, keeping the grip levels on all the wheels the same, the car would grip to the road like it had glue on its wheels. I reduced the grip on all and the car would just under steer like crazy and go in a straight line when I turn. I tried to create it so it would lose the back end when going round a corner and that worked well, until I lost it completely and it span so ridiculously as the front had so much more grip. When I implement a handbrake for the back wheels it doesn't make the back lose grip, it just makes the car stop pretty much instantly.
↧
How do I calculate grip of a tyre and make it grip and slide realistically?
The unity wheelcollider is useless for what I'm doing so I have to make my own system. This means I have to create my own tire physics but I don't know where to start. I am trying to create an arcade driving game where it grips the road nicely but will start sliding when you want it to and its easy to control. I can't do this with the wheel collider as I can only get it to only have under-steer or have a system where it feels like I have metal plates under the rear wheels and it will over-steer too unrealistically and it looks terrible..
↧
WheelCollider - Problem with model rotation
First of all I have to mention that I have just started to get familiar with Unity engine, so my question is probably really basic. :)
As my first task I would like to create simple car with simple controlling so I followed this tutorial on Unity's site: [WheelCollider Tutorial][1]
I could achieve to control my car but I stucked at adding a visual model to wheel collider.
Here is my object hierarchy and how I set the models:
![alt text][2]
And this is the scene and game windows:
![alt text][3]
As you can see on the scene screen the wheels' rotation is fine but when I start the game it goes wrong. The wheels are turning and rotating but on a wrong way furthermore the car is not moving when I rotating the visual models. If I turn off the visual rotation the car is moving.
My assumption is I cannot rotate the wheels' model on scene because it will be rotated back according to the script: (I'm using the same code which is in the tutorial)
collider.GetWorldPose(out position, out rotation);
visualWheel.transform.position = position;
visualWheel.transform.rotation = rotation;
So my questions:
- How should I set the visual wheel models to display them correctly on scene and in game as well? And keep the car moving.
- The tutorial gets first child transform and after that it gets again transform of visualWheel. Why it is necessary? Shouldn't we use only visualWheel?
[1]: https://docs.unity3d.com/Manual/WheelColliderTutorial.html
[2]: /storage/temp/80041-unitiywheelcollider2.png
[3]: /storage/temp/80042-unitiywheelcollider2.png
↧
Unity WheelCollider restore state
In my project I must add car state restoring in lap, after reaching e.g. checkpoint. So I need to restore car position, forces, etc. but is it even possible? There is rpm in wheelCollider which cannot be modified.
In my test:
1. Car accelerates.
2. Through first checkpoint - save state (car position, velocity, rotation and data which depends of project).
3. Through second checkpoint - restore state. Saved time and velocity between second and first.
4. Through second checkpoint again - time and velocity is not the same(velocity increased) - difference is about 0.5s (in ~7s between).
What should be stored also? motor torque is calculated dynamically.
↧
↧
How to get a smooth average of wheel collider RPM;
Ok so I am trying to get the average speed of my wheelcollider rpm's so I can create a sound with gears for a car. However when it gets near a gear boundary it sounds even worse than it does before or after. It jumps around sounding horrible because of this. Before I put in the Time.deltaTime, it was jumping around 100 to 200 every frame. In perspective the fastest I want my car wheels to go would be about 1500 rpm. Here is the code I have so far.
averageRPM = 0;
for (int i = 2; i < 4; i++)
{
averageRPM += colliders[i].rpm * Time.deltaTime;
}
averageRPM = (averageRPM * -1) / 4;
↧
Wheel collider and joystick
Hi all you great minds.
I am trying to connect my mobile joystick to my car, so that I can make a small racing game on my mobile phone.
I am having an issue with connecting the virtual joystick to my car. I got the car rolling by using my arrows, but I can't make the connection between the joystick input and the car itself.
This code moves the car:
for (int i = 0; i < 2; i++)
{
wheelColliders[i].motorTorque = accelerate * maxTorgue;
}
This code shows me the coordinates for the position of the joystick:
public virtual void OnDrag(PointerEventData ped)
{
Vector2 pos = Vector2.zero;
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(bgImg.rectTransform, ped.position, ped.pressEventCamera, out pos))
{
pos.x = (pos.x / bgImg.rectTransform.sizeDelta.x);
pos.y = (pos.y / bgImg.rectTransform.sizeDelta.y);
float x = (bgImg.rectTransform.pivot.x == 1) ? pos.x * 2 + 1 : pos.x * 2 - 1;
float y = (bgImg.rectTransform.pivot.x == 1) ? pos.y * 2 + 1 : pos.y * 2 - 1;
inputVector = new Vector3(x, 0, y);
inputVector = (inputVector.magnitude > 1) ? inputVector.normalized : inputVector;
//MoveJoystic image
joystickImg.rectTransform.anchoredPosition = new Vector3(inputVector.x * (bgImg.rectTransform.sizeDelta.x/3),
inputVector.z * (bgImg.rectTransform.sizeDelta.y/3));
Debug.Log(pos);
}
}
I thought that the solution could be in this code, but I cant find it:
if (moveJoystick.inputVector != Vector3.zero)
{
movement = moveJoystick.inputVector;
}
Does anyone of you guys have any experience with this type of work?
↧
Help me with my project's wheel colliders plzz
just look at my project and alter in the scene and plzz kindli help me... this is just a 10 MB file ,
Link : https://drive.google.com/file/d/0B0pt3949rh0xSTdlcWZxdzZfOHc/view?usp=sharing
↧
Aircraft Jet wheel Colliders Making My Jet Shake On The Ground
I am new to Unity and I have used one of the Jet Prefabs that comes with the Vehicle assets.
My problem is that when the Jet is on the ground it Shakes horribly until I take off. I have figured that the problem lies with the wheel colliders but I have no idea how to fix it. Other posts about Vehicles shaking have not helped me.
Please help :)
↧
↧
Wheel colliders take 0 force to compress, decompress instantly
I made a pretty simple tank using 6 wheel colliders. It controls pretty well after I tweaked the friction settings, but now I'm having a problem with how the suspension compresses and decompresses. When the suspension compresses, it takes 0 force to do this. The wheel instantly jumps to its new position with no effect on the vehicle. Similarly, when dropping off a ledge, it will instantly snap back to its fully extended state in a single frame.
Combined with some interesting terrain, the tank thinks it's rolling backwards downhill when obviously it shouldn't be behaving this way. To be clear I'm not pressing backwards here, it's rolling backwards and even accelerating backwards all by itself.
https://dl.dropboxusercontent.com/u/682625/ShareX/2016/10/2016-10-27_18-25-25.mp4
Is there any way to tweak this or prevent this from happening? I think most of the problem is that the wheel doesn't "exist," it's just a raycast in this case. As soon as a higher step appears it assumes it's already on top of that, the wheel doesn't have to roll up that part so it gets to ascend the steep side of this obstacle for free. I have a feeling that this can't be solved with wheel colliders.
↧
is their a way to make an AI using Wheel Collider and the Navmesh agent ?
hello, i'm trying to make a IFV game ( basically a tank game ), and i was wondering if their a way to use the wheel collider and (or) the Nav mesh together. if someone could guide me or sudgest me, it will be great !
↧
Detect high rotation
I want to detect rotation of my car object so if it's to high I will set it to the ground again. I thought it will be easy. I used
if (transform.rotation.eulerAngles.x > 30)
{
Debug.Log("Too high!");
}
}
to see if it works. And Debug Log is triggered even with rotation 0. Why is that?
↧
Wheel Collider problem
Hi,
I'm new to unity and I am scripting in C#. When creating my car for my project, I have made four wheels and added wheel colliders through following [this tutorial][1] . My problem is that when I play the game, the object bounces up straight away and starts spinning. I feel that the problem is with the wheel colliders hitting the plane, however, I don't know how to fix this.
Any help is appreciated.
Thanks,
Will
[1]: https://www.youtube.com/watch?v=CVO3WezvAzQ
↧
↧
How can I allow WheelColliders to free-roll?
I imported the Vehicles package and dropped a car into my scene. I placed it on a plan with a rotation of 10 degrees. I would like the car to free-roll when on an incline. Can anyone tell me how to achieve that please?
↧
Random jumps from default settings for WheelCollider when used on light bodies like RC cars
Are there appropriate settings that work on relatively light rigid bodies that weight like 20Kg?
↧
Using non-convex meshcollider with rigidbody
I want to build a car using wheel collider, mesh collider and rigidbody. The problem is that unity wants the meshcollider to be convex, and that cannot happen because my base model is bigger than 255 poly's. I have tried to figure it out but it didnt work, any hints?
↧