GetRandomInDonut() – Random location in a donut area

[tweetmeme source=”neoRiley” only_single=false]The scenario is: you’ve got a player object, and you want to spawn enemy characters away from the player, but within a range.  Basically, within a donut area, right?

using UnityEngine;
using System.Collections;

public class Utils
{
    public static Vector3 GetRandomInDonut(float min, float max)
    {
        float rot = Random.Range(1f, 360f);
        Vector3 direction = Quaternion.AngleAxis(rot, Vector3.up) * Vector3.forward;
        Ray ray = new Ray(Vector3.zero, direction);

        return ray.GetPoint( Random.Range(min, max) );
    }
}

To use it, just call it with the minimum and maximum distance away you want your new position to be. Then add it to the transform of where your player’s spawn point is:

public void LoadCharacters()
{
    // add the transform's position since the returned position is from a location of Vector3.zero
    Vector3 pos = transform.position + GetRandomInDonut(20f, 50f);
}

Chance to win an iPad 3 from the folks at BrassMonkey!

Hey everyone, I know it’s been a while since I’ve posted, but I do have some goodies coming up shortly for Unity development ;)

BrassMonkey is hold a contest for a new iPad3 for playing Tank vs Alien – for details, head on over to BrassMonkey!

Unity Flash Export – Now Available in Open Beta

[tweetmeme source=”neoRiley” only_single=false]Just released – the Open Beta developer preview of 3.5 which, as you may have anticipated, includes the Flash Exporter.  For those of you who have spent your Flash 3D lives without a decent editor, prepare to soil yourselves.  Come to the dark side and see where I’ve been living (and loving) for the past 3yrs!

Unity Open Beta

Jing Goodness

[tweetmeme source=”neoRiley” only_single=false]Well, I guess it’s true – it doesn’t mean as much to you until you pay for it, right?  I’d been getting awesome help from Techsmith with a Jing Pro acct for over 2 years now, and I’ve LOVED it.  I use it on a daily, if not hour basis ;)  It’s the best tool out there for quickly capturing and sending/storing/saving screen captures (does video capture as well).  I used to use snagit all the time, then when I moved to mac, I had to find something else and Jing came out shortly there after.

Now, after years of begging for freebies, I finally decided that it was well worth the $14.95 to pony up the cash this time.  I use it, I love it and it was time to say thank you to Techsmith, Brooks and Betsy for being so extremely cool and helpful.  If you haven’t tried it, you should definitely install it and give it a go – you’ll be hooked ;)  You can use Jing for free of course, but if you’re a heavy user like me, it’s the best money you’ll spend on a subscription this year.

Finally, a big MASSIVE thank you to Brooks Andrus and Betsy Weber for helping me out these last few years with a pro account – you guys were the best in Toronto at FITC (one of the best conferences ever!) and I look forward to seeing you again when Shawn lets me speak about Unity3D at FITC Conferences :)

Jing History

Copteropolis – Canyon Run

[tweetmeme source=”neoRiley” only_single=false]

It’s nearly ready!

Copteropolis (was StuntCopter): Coming Soon

[tweetmeme source=”neoRiley” only_single=false] I’ve been BUSY!  Between IR5 work and my kids sports, I’ve had very little extra time to work on projects.  However, a little while back, I got the urge to breakout Battlefield 1942 and install the Desert Combat Mod so I could fly the helicopters again!  If you played the game, then you know – it’s helicopter controls were the BEST EVER!!  It took me a month to figure out HOW to fly them because of the rudder controls with pitch/roll combined.  But once a friend of mind showed me, I OWNED EVERYONE.  Even the jets feared me.  I loved flying the helicopters in that game!

Well, I finally snapped and decided I was going to try and recreate the controls and feel and see how hard it was to create that sensation in Unity.  It was definitely a bit of a labor, but I had it dialed in in about a weeks time and it rocks \m/

So, of course, I decided to create a game – StuntCopter!

Copteropolis

The Refinery Compound

The story line is that we have a helicopter academy and we’ve secured 2 abandoned locations, so far, for helicopter training: Copteropolis and The Old Refinery Compound.  As a pilot, you’ll have the ability to free fly around both locations and learn how to pilot the helicopters.  Take you’re time as you learn in the slow but sure Huey.  Taking off, landing and turning all sound very simple until you have to work with throttle and rudders along with pitch and roll at the same time!  As you become more comfortable and consistent, move up to T.C.’s chopper of choice -Hughes 500D.  It’s quick, is very touchy with the controls, but can take harder landings because of the height of it’s landing gear, and might be the perfect choice for those more detailed courses.  You’ll also have access to the more recent BO 1o5 helicopter – you may have seen it doing back flips on youtube!  This heli is FAST!  Not as nimble as the 500D, but if you’re looking for flat out speed, this is the copter of choice.

And don’t worry – I put in noob controls so you can fly it with 2 thumbs.  However, you’ll be limited to certain tracks and courses, so you just might want to man up from the beginning and fly with the true controls.

There are 3 competition types:

  1. Rescue:  In Copteropolis, you’ll be trained to locate accidents and air lift victims to the nearest hospital!  The closer you land to the middle of the landing circle, the sooner the victim is loaded and you can fly to the hospital.  How fast can you save everyone?
  2. Race:  In Copteropois and The Refinery Compound you’ll have to race through obstacles to beat your best times.  You’ll be ghost racing against yourself!
  3. Car Chase:  In Copteropolis, you’ll have 2 choices of difficulty for a car chase:  OJ’s bronco (easy), or the Ferrari (difficult).  The goal is to block intersections before the car gets to them to force them up on the freeway down to the either end. You have to master the controls to even think of attempting either vehicle chase!

The game functionality is nearly complete and I’m working on create more levels for ghost racing, but it’s nearly there!  I’ll post about it again once it hits the app store, but I’m also considering releasing it as a web game, so I’ll be posting details about that soon!

[UPDATE] – thanks to someone being more heads up than me, it was discovered that an iPad game called “StuntCopter” has just been released! I’m changing the name and for now, it’ll be “Copteropolis”.  Suggestions are welcome!

Until then check out the first demo video featuring footage from all 3 competition types:

Screens:

New Aerial Combat Demo & Tutorial

[tweetmeme source=”neoRiley” only_single=false]Well, people often wonder why I tweet so little and why there are such long stretches in between.  The answer is simple enough:  I work.  Well, it’s more complicated than that, I work, I’m headcoach for my son’s football team, my daughter is in both soccer AND volley ball and I’m involved in all of them in some way or another.  That, and I just came off of a really nice game project that took 7 months of my life, and I can’t seem to do social network stuff while working and still be productive.  I don’t know how you all do it!  Anyway, I’d been wanting to do SOMETHING of a blog post just to get back into contributing to the Unity community, and so when I came off this current project, it was my turn to post something on the IR5 blog – YAY!

So, since Unite 11 is starting today and I’d promised to do a demo on this back in 09′ while speaking at Unite 09, I figured it was time to make good on my promise.  I’ve finally put it all together in a very simple, yet flushed out, demo of how I did dog fighting in The Trench Run.

Check out the post, files and demo over at infrared5.com

Enjoy!

Follow

Get every new post delivered to your Inbox.

Join 785 other followers