Hello ,
I am Moving my game object left and right within X-Y plane same like 2D shooter game.
My gameObject get destroyed when it collides.
But collision occures when i write below code:
var amttomove : float = Input.GetAxisRaw("Horizontal") * playerSpeed * Time.deltaTime ;
transform.Translate(Vector3.right * amttomove);
When i move my game object By touch it does not collide.
if (Input.touchCount > 0 &&
Input.GetTouch(0).phase == TouchPhase.Moved) {
// Get movement of the finger since last frame
var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
// Move object across XY plane
transform.Translate (touchDeltaPosition.x * playerSpeed * Time.deltaTime, 0 , 0);
}
So what can be the reason? What should i do onTouch so that collision occure ?
Please help me.
Thanks to all of you for your support and help.
↧