playMaker

Author Topic: Simple ball flicking game, please help.  (Read 1991 times)

doomminion

  • Playmaker Newbie
  • *
  • Posts: 2
Simple ball flicking game, please help.
« on: February 22, 2014, 02:00:28 AM »
Hi,

I'm very new to Playmaker and Unity and I'm trying to create a game where the following occurs:

- A Ball is spawned
- If the Mouse is over the ball and the player Left-Clicks and drags the cursor in any direction the balls is 'flicked' in that direction.

I'm completely stuck on how to do this and would appreciate help, please keep in mind I'm new to this so please elaborate a fair bit.

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Simple ball flicking game, please help.
« Reply #1 on: February 22, 2014, 10:12:55 AM »
I would read up on Raycasting, because you would need to send a raycast from your mouse position, then you will need to Add Force to your sphere to get it moving in the direction.

doomminion

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Simple ball flicking game, please help.
« Reply #2 on: February 22, 2014, 09:47:27 PM »
Hmm, that answer is a bit vague for me to understand.

How do you specify the mouse pointer's location as a position though in Raycasting?

The only Parameters there are Raycast:
1. From Game Object
2. From Position
3. Direction
4. Space

Also using the Add Force action, means you need to specify the Force parameter on the X,Y,Z axis. I am trying to move the ball in the same direction the mouse pointer is moving, not setting an arbitrary value like X Axis: 300 any time the user left clicks.   


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Simple ball flicking game, please help.
« Reply #3 on: February 25, 2014, 07:10:47 AM »
Hi,

Use the "mouse pick" action.

bye,

 Jean