Jump to content
Sign in to follow this  
Gregory McLeod

kicking a ball

Recommended Posts

If I could find a way to have a ball always attached to my feet I could run with it and then kick it.

How do I get the ball to always be in front of me?

How do I kick it and have it move independently according to som eimpulse given to it/

Share this post


Link to post
Share on other sites

Make the ball a physical object.  It will respond to any collisions, so all you have to do is bump into it. If you want to be more sophisticated, create a HUD that will activate a "kick" animation when you click on it and will send a signal to a script in the ball, giving it a llApplyImpulse.

Share this post


Link to post
Share on other sites

You do it the same as it's done in RL- chase it until you get to it.

 

{Edited to add ...] If you do it repeatedly, you'll figure out what happens when you "bump" a physical object. Practice will be needed, a lot of it.

Share this post


Link to post
Share on other sites


LepreKhaun wrote:

You do it the same as it's done in RL- chase it until you get to it.

 

{Edited to add ...] If you do it repeatedly, you'll figure out what happens when you "bump" a physical object. Practice will be needed, a lot of it.

And I'd suggest giving the ball a little bit of negative buoyancy so that it doesn't go sailing up into the air like a beach ball. :smileywink:

Share this post


Link to post
Share on other sites

can make an attachment that you wear on your back. say a box (but can be any shape) make it alpha so is invisible but you can click on it easy

in the box put a ball that is physical. texture it how you want. can put a script in the ball to add effects to the ball like Rolig says. is optional that to start with but you probably will later on

+

is a soccer ball i think you want. to be able to dribble it and stay on the ball

ok when click the box then script rezz the ball

the script then puts a follower on the ball. llMoveToTarget. so your avatar run into the ball. the ball being physcial will move bc has been bumped by you. your avatar then move to the ball. bump again and so on

+

ok. next. bc thats not much fun bc you got no control over where the ball goes.and no control over your avatar either

so. in the script you llTakeControls so can start/stop the follower

when press PgDn then it toggle the follower to On/off

if Off then you can move normal and stop moving to the ball. if On then avatar go to the ball and bump it. if press any other key while is On then it pause the follower and your avatar can move normal. so can run round the ball and then release the keys. avatar will then move to the ball and bump it from new direction

+

next part is to be able to long kick the ball. like a 4 or 5 meter kick. say from the penalty spot. ok

in TakeControls when press PgUp then it apply some impulse to your avatar. llApplyImpulse. if you facing the ball then your avatar will bump the ball with more force bumping it harder.making it go further

if switch to Run mode then you can move faster. and dribble the ball faster

+

the secret is the follower. llMove2Target. it helps you stay on the ball

when get good at it then can go into Run mode. and just use left right arrows to steer and use down arrow to brake a bit into the turns. kinda like a stutter step. and can slam it with PgUp every now and again to make more faster dribbling

+

can add effects to yourself. as was mention by others. can make/get a kicking animation that plays when press Pgup key

+

edit add: just for anyone making a trick ball for a easy to play way where just want to run round and kick it yourself. and use llMoveToTarget

when follow is On then before MoveToTarget while fire have the script check for avatar orientation. only fire the moveToTarget when avatar is facing the ball close enough. it can look a bit funny otherwise bc your avatar will move sideways into the ball if don't have a animation for it

 

 

Share this post


Link to post
Share on other sites

Gee, I thought that was practical help. In RL, you stay with the ball by following it, not by tying it to your foot with a rubber band.  The same thing works in SL.  You can knock a ball around in SL by simply running after it and bumping into it.  You don't ned to cheat by adding some scripted way to know which way the ball will move ahead of time.  As I said before, you can add realism to it by activating a kick animation now and then, and you can use that as a way to telegraph an extra impulse to the ball.  The basic running and following business, though, is all pretty much like RL.

Share this post


Link to post
Share on other sites

Rollig,

It was not your reply I was referring to as "not helpful". I apologise if I gave that impression as I know you of old and respect your contributions highly.

It appears that my clicking the reply button under the input from leprekhaun did not attach my reply to his input but at the end.

My sincere apologies for my bad.

Your latest very helpful input has given me the key to a problem I was having trying to decipher some code (not mine) and for the life of me I could not find where the ball got itself attached to the avatar. I can see it now it is all to do with a HUD which is attached to the avatar and from that it would be able to set the llMoveToTarget after rezzing the ball.

Thanks again.

Share this post


Link to post
Share on other sites

NP.  Have fun.  :smileyhappy:

Also, visit some of the SL football league games if you have a chance.  You may get some ideas by seeing how they handle the ball. Their systems for scoring and managing penalties, etc.   are very elaborate.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...