- Home /
how to make a game easier
Hey guys i am developing a cricket game. The animation and all is working fine. But it is becoming extremely difficult to time the shot accurately. Means the batsman misses every shot.
I tried increasing the size of the collider. Even that doesn't seem to help much.
Please keep in mind i am new to unity and go a little soft. :)
I'm having trouble visualizing the issue. Conceptually I understand, but the actual mechanics are missing. A short video or even a screen shot would be helpful.
$$anonymous$$ i have attached the picture of a shot to the right. the bat needs to hit the ball like in baseball.
But, unfortunately, a picture of it doesnt tell anyone what could be wrong with it.
Usually, when it comes to collision issues, is either your code or the way you are moving the object. $$anonymous$$oving objects and non moving objects tend to have problems detecting collision depending on how the moving object is coded.
Answer by TASNO · Feb 09, 2013 at 12:21 PM
Maybe you should make the sphere collier on the ball a little bit bigger so the bat would be able to hit it?
TASNO :P
Answer by souperdavecdn · Feb 09, 2013 at 11:52 AM
Couple of tips for troubleshooting moving things/collisions
Slow down time, it's awesome Unity Editor Menu /Edit /Project Settings /Time Change "Time Scale" to something slower than 1 Now run your game and see if things do actually collide
Debugging Aids Attach the script DebugCollision.js (below) to both game objects involved
// ------ DebugCollision.js ------
function OnCollisionEnter(collision : Collision) {
// Displays the names of all objects we are currently touching in this physics frame (in the Debug Console)
// Multiple contacts can occur simulatenously
for (var contact : ContactPoint in collision.contacts) { // Cycle through each point that is contacting another object
Debug.Log(this.name + " hit " + contact.otherCollider.name); // Display the name of this object and the one we hit
}
}
// ------ DebugCollision.js ------
There could be many other reasons why your game doesn't do what you want it to but try these tips to help identify what is currently happening. I hope this helps you.
Soup.
Your answer
Follow this Question
Related Questions
Simplifying code - similar array names 1 Answer
Change level after ''X'' seconds 2 Answers
Need to alter script to load next level when level is completed 1 Answer
Why do i get error that level is not in build settings when i can see that it is in multiple ways? 2 Answers
Looping scenes by pressing "X" button on PS3 controller 0 Answers