Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Go down
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 990
Rep : 0
Join date : 2015-12-03
View user profile

Bat movement and physics for Squash

on Thu Dec 03, 2015 6:21 am
Hi guys! I posted my query originally in Unity official forums but couldnt get a reply there, so hoping someone here might be able to help me out! Smile

I am total novice in Unity Game programming. I am trying to create a demo squash game with a room, one ball and one racket / bat. Now scenes are done, and ball bouncing logic has been implemented. Now I need suggestions on how to proceed further :

  • Bat movement : currently the bat movement is just stuck in one plane, and the bat itself is fixed. I want to implement a swinging bat movement on mouse drag.
  • Proper bat strike physics : currently i have implemented in the onCollissionDetected to just reverse the velocity of the incoming ball. But I want to take into account the bat swinging velocity
  • Camera View following bat : I tried to implement the "SmoothFollow" script to the bat element, but since I am already taking mouse input on smooth following the camera just goes out of scene to eternity

Any help would be great!
Gif of the implementation till now : http://gfycat.com/BlondDirectImperialeagle
Bat Script : MouseDrag.cs : http://pastebin.com/ym09fGxZ
Ball Script : Ball.cs : http://pastebin.com/TQDKkPfv
Back to top
Permissions in this forum:
You cannot reply to topics in this forum