playMaker

Author Topic: help pinball  (Read 3928 times)

farissi

  • Playmaker Newbie
  • *
  • Posts: 8
help pinball
« on: January 11, 2014, 12:18:58 PM »
Please help in the programming push a ball tossed
Drawing in the picture shows what I want
Give me a video programming stages
From a z

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: help pinball
« Reply #1 on: January 11, 2014, 09:07:19 PM »
Sorry this isn't a video showing the programming of all stages (from a to z) of a pinball game.
But have you considered the fact that real pinball is essentially a physics game? Just emulate that. Add a rigidbody element to the ball, set it on an inclined board, make a couple of flippers with 3d colliders that rotate when you hit a button and you should be good to go. Gravity, collisions and the shape of the board will do the rest.
« Last Edit: January 11, 2014, 09:09:21 PM by MajorIdea »

farissi

  • Playmaker Newbie
  • *
  • Posts: 8
Re: help pinball
« Reply #2 on: January 12, 2014, 09:09:34 AM »
Mr.MajorIdea. Basta problems when throwing a ball
Disobeyed push the ball
Programming used by
Collision Event .. .keydown.. addforce
Programming is useful
When they pass the ball
Touch Collision Event Do not press keydown In the area push
I hope writing programming stage only push the ball
Photo showing erroneous programming of throwing the ball

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: help pinball
« Reply #3 on: January 12, 2014, 12:50:17 PM »



...why do you need to add forces to the ball? Don't you want the flippers to push the ball like in real pinball? What I suggested involved no addforce or collision events (at least for the basics of pinball mechanics)

Also how about considering this for example: https://www.assetstore.unity3d.com/#/content/11253
« Last Edit: January 12, 2014, 12:53:12 PM by MajorIdea »

farissi

  • Playmaker Newbie
  • *
  • Posts: 8
Re: help pinball
« Reply #4 on: January 12, 2014, 02:51:35 PM »
Mr.MajorIdea
How to use collision event
Not the force of
Please tell me the stages Please
Why Use

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: help pinball
« Reply #5 on: January 12, 2014, 03:24:07 PM »
I never made a pinball game, but here's what I would do to create the main mechanics.

1- Import your 3d pinball table model. Make sure it's not parallel with the floor but has a slight inclination, so the ball will roll down with gravity.

2- Place a simple sphere on top of the model. Add a rigidbody component to it. Press play. Does it naturally roll down the board just because of gravity? It should.

3- Import some flipper models. (Make sure the pivot of the 3d model is in the center of rotation). Now add an FSM to both of them. A simple two event FSM should do:

3.1-"OnKeyDown" where you wait for the key imput.

3.2-"Rotate" where you add a rotate action. Maybe an itween rotate? Not sure if a transform-rotate would work because it's not physical. Just test it. Tweek the values to make it rotate quickly like a real flipper.

3.3- Actually you probably need an extra step to reset the rotation to it's default position when you're not pressing the key. Maybe you can simply add a "itween rotate to" action to the first event. If the flippers are in the right stationary position you can copy the flipper's rotation values from the inspector to here.

4- Test it, see if the ball rolls down by itself and gets hit by the flipper when it rotates. If so you'll probably need to tweek the rotation speeds of the flipper, the drag and mass of the rigidbody component of the ball to make it feel right.

I'm not a programmer but I think that should cover the basic mechanics.

PS.  Please don't call me Mr.   xD

« Last Edit: January 12, 2014, 03:28:11 PM by MajorIdea »

farissi

  • Playmaker Newbie
  • *
  • Posts: 8
Re: help pinball
« Reply #6 on: January 12, 2014, 03:55:04 PM »
These stages you've made the whole
Stage where he faces difficulty is the stage
Programming pin
To fling the ball

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: help pinball
« Reply #7 on: January 12, 2014, 04:00:56 PM »
I'm sorry mate, but I haven't the foggiest idea of what you're asking  ???

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: help pinball
« Reply #8 on: January 13, 2014, 07:42:54 AM »
Hi,

You need to start with smaller tasks.

-- can you have a rigid body ball falling on a tilted collider
-- can you put static obstacles for the ball to collide against as it falls
-- can you create a collider that you control for rotation and kick the ball


as far as physics setup, I would go for a 2d physics IF your pinball is flat, I know some pinball are in 3d with some weird paths and multi level layout, but if you start with all this, go for 2d.

Bye,

 Jean

farissi

  • Playmaker Newbie
  • *
  • Posts: 8
Re: help pinball
« Reply #9 on: January 14, 2014, 10:14:41 AM »
Hello
I just want programming pin
To fling the ball forward
  Image shows Why
Do not want a
Is Help mr jeanfabre

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: help pinball
« Reply #10 on: January 14, 2014, 10:21:38 AM »
It is basically impossible to understand what you are asking.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: help pinball
« Reply #11 on: January 23, 2014, 07:10:16 AM »