playMaker

Author Topic: Any idea how recreate "simple" football prototype?  (Read 986 times)

pixeloved

  • Playmaker Newbie
  • *
  • Posts: 2
Any idea how recreate "simple" football prototype?
« on: June 11, 2019, 07:22:43 AM »
Hi guys, I am glad to be here- I bought Playmaker few months ago and now I started using it, so I am total newbie.
I've found online some cool video
I assume that owner of a movie don't care about this prototype anymore (date of adding movie speaks for itself), so I am asking you; anyone have idea/ could give me some tips to create something similar (weak passing ball, strong shooting, maybe even lob)?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Any idea how recreate "simple" football prototype?
« Reply #1 on: June 11, 2019, 08:41:44 AM »
Hi,
I did not look to the whole video,

But i think what he is doing is :

When player touches the ball : Parent ball to player (so ball moves with player) and probably rotate the ball to have the forward position correct (so that when shooting ball, the ball shoots in forward direction)

When pass button clicked : un-parent and and do a add force (i believe in the z direction) with a lower value

When Shoot button clicked : un-parent and and do a add force (i believe in the z direction) with a Higher value and also probably add some Y force as well (upwards) .

When Shoot button clicked : un-parent and and do a add force (i believe in the z direction) with a medium value and also add some higher Y force as well (upwards).

Hope this helps :)

pixeloved

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Any idea how recreate "simple" football prototype?
« Reply #2 on: June 13, 2019, 01:42:51 PM »
Thanks djaydino, that logic seems to work fine, just as I would try to write it in pure C#.

Anyway, I modelled basic field and placeholders for enemies, got two goals (I tested, when Player runs into trigger in goal, Playmaker lits it's state in green- later will replace it with ball).

Why I mentioned ball itself? Because I can't stick it to Player; can someone take a look and tell me what is wrong? Ball is just acting like regular object and it goes away from the Player :/

I am pretty sure that I messed up something with Actions, but I am total newbie in this matter. Maybe ball shouldn't have action with Set Parent or something like that?




http://i67.tinypic.com/213ncs6.jpg
http://i67.tinypic.com/33a9kzk.jpg
« Last Edit: June 13, 2019, 01:46:01 PM by pixeloved »

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Any idea how recreate "simple" football prototype?
« Reply #3 on: June 14, 2019, 12:47:28 AM »
First, what is the purpose of your Get Child? It seems redundant at the least, because you can specify your gameobject to parent to later without pre-setting it at that time. Also.... it's getting an object called "ball" to use as a parent later? As in... the ball? Or is it an object in the Player you are using as a holder for the ball later, to get the right position or what ever? If this is the case, I suggest you rename it to something like "ball holder", just to not confuse yourself later.

Next; the Ball has the Trigger Event and the Set Parent in the same action. This means before it's even triggering, it's already setting it's parent... and as with the above, to whom is it getting parented to? An object with the name "Ball" and also has the tag "Ball"

The Set Parent should be in the Picked Up state, that way it won't happen until after the trigger event.

Something like this would make more sense to me

PLAYER
* Have an object for your player

* Have an object parented to the player in the hierarchy called 'BallHolder'. Position it where you want the ball to snap to when the player receives it

-------

BALL
* Have a trigger event in the idle like you already have. It should look for the tag Player and send the event PickUp. It should also Store Collider, and use a logical name like 'PlayerWithBall', or etc, as the gameobject variable name.

* In the Picked Up state, do a Get Child for the game object variable 'PlayerWithBall', and tell it to find the Child Name 'BallHolder' (your holder object in the player). Store the result as a logical name like 'BallHolderVar', or etc

* AFTER the Get Child (top to bottom sequence in an action is the order it does things), do your Set Parent. Choose Use Owner (the ball) for Game Object and choose 'BallHolderVar' as the Parent. If you have the Reset Local Position and Reset Local Rotation on, this will mean it will snap to the center of your object called BallHolder.

When the ball is kicked up, do a Set Parent again and leave the Parent as blank (so it will have no parent). Make sure the set position and rotation is off for that one, or it will go to the center of the scene.