PlayMaker Help & Tips > PlayMaker Help

How to setup player to possess ball, throw ball and have ball knocked away

<< < (2/2)

Rabagast:

--- Quote ---How do I get the ball to change its location upon pickup so it centers itself in front of my player, rather than the spot at which the trigger collides?

--- End quote ---

Maybe you can use Set Position or use an Empty Game Object and place it in the front of the Player and set the position of the ball to that game object.


--- Quote ---Also how do I add diagonal directions to throw? 'Axis event' only gives me mutually exclusive options. Ideally i'd like the ball to be thrown in exactly the direction of the controller stick, is there a simply way to set force direction according to axis direction?
--- End quote ---

On "Add Force", if you change the space to self, then the object moves the direction it's facing. If you use "Add Force 2D", then you need to use "Add Relative Force 2D".

mr0boe0jangles:
Thanks Rabagast,

I'll try to use set position to put the ball at the right spot relative to the player once parented. Would you suggest parenting it to a hand rather than the whole object so it looks like its being held??

Using add force Self - my issue is I want the player to be able to throw the ball in any direction, not only the way he is facing, and up or down (currently my player on rotates in the Y axis), so he is never 'facing' up or down'.

Is there any way to store a vector value and use it for the force direction, rather than just defining up down etc so I can use a joystick/controller?

Added a video showing in more detail my issues.
//www.youtube.com/watch?v=6I17K4HVa-w

Rabagast:

--- Quote ---I'll try to use set position to put the ball at the right spot relative to the player once parented. Would you suggest parenting it to a hand rather than the whole object so it looks like its being held??
--- End quote ---

Hi!
I would use an empty game object which you place it on the hand and when you pick up the ball, you set the ball to the position of this empty game object.


--- Quote ---Using add force Self - my issue is I want the player to be able to throw the ball in any direction, not only the way he is facing, and up or down (currently my player on rotates in the Y axis), so he is never 'facing' up or down'.
--- End quote ---

I'm not 100 % sure how to do it. Maybe djaydino knows it. He's better than me. :)

Navigation

[0] Message Index

[*] Previous page

Go to full version