Hi guys.
First, I apologize for my poor English.
I am working on a project, which I have to use my accelerator of a smart phone, and use the data to control my First Person Controller.
My problem is, when I use my script,
the First Person Controller will walk through other object and terrain,
or touch the object, but it doesn’t stop, and it just like the First Person Controller is PUSHING the object.
But when I use the same First Person Controller and close my script, it doesn’t have any problem.
Here is some code of my script
if(-0.75<inputX&&inputX<-0.45)
transform.Translate(4*Vector3.left*Time.deltaTime);
else if(-0.45<inputX&&inputX<-0.15)
transform.Translate(2*Vector3.left*Time.deltaTime);
else if(0.15<inputX&&inputX<0.45)
transform.Translate(2*Vector3.right*Time.deltaTime);
else if(0.45<inputX&&inputX<0.75)
transform.Translate(4*Vector3.right*Time.deltaTime);
where inputX is the data I get from the accelerator of the smart phone.
Can anyone tell how to fix it? Thanks.