Bawl Physics v2.0


Current Version - 2.01

Bawl Physics is a fun set of abilities for a physics ball that you can use to make small marble games or larger games with grappling, boosting, wall jumping and wall magnetizing.

You can buy this on my site if you don’t want to use Unity’s Asset Store.
Download Standalone Player
Website
This is on the Asset Store for $10.

Now that this is up, I will work on making the script work in full 3D (On the X,Y and Z axis) instead of just on two axis (X and Y).

Maybe it’s my slow computer, but jumping only works like one fourth of the time.

Seems to work fine on my slow computer :slight_smile:

It was even worse before when the Fixed Timestep was set to the default .02. When I set it to .01 it started acting the way it should but occasionally the jumping slips, just not as often. I don’t think there’s much I can do about that. I might try a lower Timestep if it lets me.

I added the 3D to the script. It should be updated in the Asset Store soon, not sure exactly when though. When it does, the version will be 1.1. A preview is in the Bawl Physics 3D - WebPlayer at the top.

Mmk the update is on the asset store so if you’ve already got it, redownload it… I think that’s how it works! I haven’t bought anything on the store yet so I’m not 100% sure.

I’m trying to see if I can get the controls to work a little bit better in 3D mode. Right now, if you go up a straight wall and try to go left or right, you can’t. I’m also making a ball pack that I’ll put on the store for free. So far I’ve made a couple ball types and finished them, Wooden Ball and Spike Ball.

I’ve fixed the 3D controls, you can now go sideways on walls. If you want to test it out you can click the link here http://dl.dropbox.com/u/17783172/Bawl%20Physics%20Testing/WebPlayer/WebPlayer.html

I’ll submit it to the store after I check the code and make sure things are ok.

It has been updated on the Asset Store!

You can now buy this on my site if you don’t want to use Unity’s Asset Store!

I’ve added a PDF and a JavaScript version of the script for the player.

Thanks to one of the Unity users, they gave me a good idea for a feature to add to Bawl Physics. Swinging. The version that it is in is 1.6. I don’t think the store has updated it yet but it should be up soon enough. The java version of the script hasn’t been updated yet because I’m thinking of something I could do to split up the scripts to make things easier for me. For each ability I’ll have a new script. That way I won’t have to try update code that doesn’t need to be updated. Finding the code I need to update between the C# and Java scripts would be a lot easier. Also, I’ll probably put the java scripts in a zip file so all the script names won’t have to be different. You’ll just have to switch out the scripts yourself though.

The BallControl script does a SendMessage for certain abilties so you can set up actions and effects in other scripts that are attached to the same Game Object. The ones it calls for are…

BallControl_OnJump
BallControl_OnDoubleJump
BallControl_OnMagnet
BallControl_OnSwinging (will be changed to BallControl_OnSwing)
BallControl_OnRespawn

A parameter is sent along with them. The variable sent is ‘this’ which means it’s sending a handle of itself so you can access it from the function when you get the call.
To use them you’d create a function with the same name and it will be called when that action happens. Example

[I][B]C#[/B][/I]
[B]void [/B]BallControl_OnJump([B]Ability [/B]ability) {
Debug.Log("Winning");
}

[B]void [/B]BallControl_OnJump([B]BallMagnet [/B]ability) {
Debug.Log("Winning");
}

[I][B]Java[/B][/I]
[B]function [/B]BallControl_OnJump([B]Ability [/B]ability){
Debug.Log("Winning");
}

[B]function [/B]BallControl_OnJump([B]BallMagnet [/B]ability){
Debug.Log("Winning");
}

Lastly, the PDF hasn’t been updated to reflect the new changes either. First thing to do right now is to split up the scripts!

I just checked the Asset Store and it has finally updated with version 1.6. In 1.7 there’s going to be a lot of changes but mostly everything will work the same. Each ability now has its own script. Any new abilities that you or anyone wants to add can be done easily. All you do is create a new script, make it inherit from the Ability class and add what you want. By inheriting from the Ability class, it gives you options for controls for that ability. You can have multiple controls per ability too. There are a few other things which I won’t explain here (yet) about the Ability class that will make it easier to make your own abilities.

The jumping has changed a little bit. You can hold down the jump button to jump whenever you hit something instead of constantly pressing the button.

One thing I haven’t figured out yet about the swinging ability is letting you drag other objects with it properly. I can make it work, but it’s really hacky and spazzy.

The java version of the script hasn’t been updated and the PDF isn’t updated.
Anyways, enjoy 1.6 and I’ll get 1.7 out as soon as I can!

will this work on iphone / android, is this planned in future updates

I don’t have an iPhone or Android so I can’t test it on those. If someone has tried this on them then that’d be nice to know if they do work though. I use a Windows 7 PC and the free version of Unity3D so I’m not even sure if I’m able to test for those.

Btw here’s an update for what I’m working on. I’ve been messing with ConfigurableJoints to see if they would work for swinging… and they do! I’m not going to say what I did to get them to work. One problem is that if you want to be able to pull the object you’re attached to, the collisions become disabled so you’ll go right through that object. I won’t worry too much about that at the moment though because there’s an option that I’ve added to enable/disable pulling attached objects. If it’s disabled, you’ll be able to collide. But it’s still better than using my hacky DistanceJoint script because with the ConfigurableJoint you can have springiness to your ropes!

About converting my scripts to Java again, can Java use Reflection like C# can?

The webplayer examples are updated with the newer swinging ability! The swinging only works for a certain distance in the example just to let you know.

Next up I’ll mess around with a little problem I’ve noticed with the magnet ability. Then if there’s nothing else, I’ll start converting stuff to Java and maybe I’ll be kind enough to make a java prefab of the player too :slight_smile: I have another ability in mind that I’ll keep secret for now.

What Am I Doing:
Converting the scripts (not the camera scripts, only the ball scripts) to Java. I have the DoubleJump script to convert and I think I’m finished with that. I’ll have to test the scripts a bit before I spit out the update.
I thought I fixed a problem with the magnet (the ball pushes objects while you’re using the magnet ability) but I didn’t, I only made it worse.

I’ll be off work for a few days on Thursday and I want to work on this more during that time. That new ability I should be able to add pretty easily and it shouldn’t take long. Just a small clue of what it is, it will require at least three variables, float force, LayerMask layerMask, and GameObject effect, bool raycastThroughWalls.

Today I’ve got the scripts converted and they appear to be working exactly how I want. Next step will be to change the PDF up a bit to reflect the changes. I’ve removed the two API files seeing as they’re now useless. The new ability has been added and I’m still not going to say what it is yet until I’ve uploaded it.

If everything goes alright and nothing is severely broken I should be able to upload the new version within the next couple of days. All I have left to do is test out the scripts and make sure everything is ok, then add some pictures to the new PDF. There’s a small tutorial showing how to make a custom ability.