- Home /
Simple car problem
Hello, guys! Now I am trying to create simple car. All is done, but my car leads left! Who can help me please do it!
WCol it is array of four WheelColliders of my car. And when I press down arrow for breaking, car turn right.
Also, when I press "play" button and don't hit move buttons, car slightly moves and rotates by "y" axis.
Also I've changed all script to very simple:
using UnityEngine;
using System.Collections;
public class CarControllerMy : MonoBehaviour {
public WheelCollider[] WCol;
public float maxAccel;
private float accel;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
accel = Input.GetAxis("Vertical");
foreach (WheelCollider col in WCol)
{
col.motorTorque = accel*maxAccel;
}
}
}
But it hasn't solved the problem.
And one more observation. When I attach game objects with wheel colliders attached to array, I see that position and rotation of parent game object are frequently сhanging.
$$anonymous$$any things, the most obvious being that you haven't supplied us with any useful information.
"$$anonymous$$y car leads left" is just as useless as it is trying to fix a car over the phone.
Do you call up your technician and ask them to tell you how to fix your own car (without any more information)? No, because that would be utterly stupid and he/she would instantly hang up on you for trolling.
Please ask useful and answerable questions in the future
ben thats awfully rude of you to say and do, Now Creat0r don't give up on this question just because you feel discouraged by ben. just take a screenshot of the code (or paste it With code tags). and we developers can identify the problem and solve it. And like ben said, we need some more information on why this is happening.
And also ben i don't really see how this question is Irrelevant, he just didn't add enough info and you will just close the topic just like that?
@Frostbite23 I've been active in this community since April 2012. I've had quite a slice of experience here. I'm not trying to discourage people from posting good questions, rather discouraging from posting bad ones.
From experience when people post questions like this one, they usually can't be bothered providing more info and never return to the website (It happens quite a lot). No-one can expect anyone to be able to answer a question like the one above and the OP should be smart enough to know this. There is no magical fix-it button and there never was.
I'll be happy to reopen the question if @Creat0r edits the question with the appropriate information, but until that happens I'll leave it as closed, because chances are (from experience) that that won't happen.
There are too many open questions like this where the OP has been asked to provide more information, but never has :)
What is probably happening is that his model is not properly aligned to the xyz axes and so it is not moving to the front because the front is not the axis he is moving to.
Your answer