Friday, May 18, 2018

TOE week 60: The Actions of Associated Objects


Basically immediately after I wrote last week’s blog I un threw away all of the work that I did for my crappy version of bouncing a ray off of a reflector. This was the first attempt that worked but also didn’t. Fixed what wasn’t working except for the multiple hits problem and got line renderer to actually work. It was like I just had to write down all of the things that were making me frustrated and then I could move on. Here is a video of it working!


 The rest of the week was also pretty good. I drew up some temp artwork for my Lazer Projector and the Power Source Panel. I created a particle effect for my the flame jets that push the player around if the portal is open. I found a better way of dealing with rotation. Using transform.rotate instead of transform.rotation is good alternative according to me. What you don’t know the difference? Neither did I. #Learning. 

On Wednesday I was kind of stumped. I didn’t know how to implement something. I have two objects that are the Power Source Goal or the Laser Beam Goal. Each of these flip a flag when they are getting power or getting hit by a Laser. But I needed them to activate their associated object, like open a door or activate a particle effect. The trouble was that what the associated object IS, is variable. So in script you specify hey I’m looking for a MovingPlatform’s script and then tell it to do a thing but if you put a Particle Effect in there the script doesn’t know what to do.

So I cheated. I created a generic mediator script that basically is plopped on top of any object, MovingPlatform, particle effect, door. The Power Source is looking for that script and that script talks to the associated object. I don’t know if this is the RIGHT answer and further experimenting may be needed. Here is a video of that working!

 
With all of these cool new elements I might be able to start building a level again…. That means I may have to start working on AI again… FUN… Next week will be interesting!

.

No comments:

Post a Comment