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

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » General Dicussions » Bat movement and physics for Squash

Bat movement and physics for Squash

Go down  Message [Page 1 of 1]

1 Bat movement and physics for Squash on Thu Dec 03, 2015 6:21 am


Member [Lv. 0]
Member [Lv. 0]
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

View user profile

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum