How do I solve this odd issue applying logic to an emitted object?
I feel like I'm missing something regarding the functionality of the Emitter here. I've made a guided missile that will lock onto tags. It has a few bells and whistles, things that I wanted to try out.
So after firing, i.e. being emitted, it has a little animation of the fins popping out, then the rocket fires up and it shoots off toward the target. Or at least that's how it's designed. What I'm finding odd is trying to figure out the relationship between the emitted object and the reference object it's based on.
When I want to make a change, I make the reference object visible and make changes there. This in itself is odd because, in the case of my missile, as soon as I press Play my reference missile shoots off and starts trying to find a target...but obviously if I try to stop it doing that, I will also be stopping all the emitted versions doing it too. If I turn off the gadets or the chip, the emitted objects then emit with the gadgets turned off. Or at least it seems that way, I can't actually tell because there doesn't seem to be any way to check on the status of an emitted object. You can't pause, select it and look at what's going on (or at least I can't seem to). Is there a way around this at all?
My main issue though is that I'm trying to have a short delay between my missile being fired and having it start up all it's systems. From my experimentation, it seems like this is because an emitted object always has the exact state that it's reference object has at the time when it is emitted.
So for instance:
1. I press Play
2. My reference missile starts a 1 second timer and then shoots off, as a missile does. This is what I want my emitted missiles to do as soon as they are emitted.
3. I lock a target in my game and fire a missile
4. My emitted missile is not in the pre-firing state because my reference object is still in flight. If I stop it being able to finish it's targeting funciton, I would stop the emitted objects doing that too!
So how can I program an emitted object with logic that involves doing things that may require these kinds of processes?
I thought the 'Emit With Wires' would separate the logic into separate instances but it doesn't make any difference and all my missiles fire without the correct initial state as a result.
-
I think I understand. You basically want every emitted object to work, as it is emitted, as if time has just started.
Have you tried using the emitter output ‘object just emitted’ (think that’s what it’s called) in the emitter gadget’s tweak menus? I use this to trigger sound effects and stuff when an emitter does its thing. I wonder whether you could use this output to send data to your emitted missile after the point of emission to change or reset its settings, maybe via a keyframe or depending on what you need to happen a wireless transmitter/receiver.
If I’ve misunderstood what you’re trying to achieve, sorry! :-) -
That actually exemplifies the issue I'm talking about perfectly. I can indeed use the 'Object Emitted' output. Problem is that my reference objects then gets that signal and initiates it's logic, therefore when I then fire another missile a couple of seconds later, the reference object is in an in-flight status rather that it's initial status, so the emitted object comes out in the incorrect state.
-
Hold on! I think I worked out what's going on. Will post the solution here in case anyone with similar woes comes looking:
So when you open the Emitter tweak and select an object to be emitted, that object (what I call the 'reference' object) will automatically be made to be invisible. You may be familiar with this. I was too but what I've only just figured out is that selecting an object to be emitted also turns that object 'OFF'! I mean literally, it turns the power off for that object (or group if the emitted object is a group).
So at some point while fiddling with the logic in my reference object, I must've noticed this and turned it back on so that I could see how it behaves when I press Play. Clearly I did this absent mindedly without really thinking about it. When I realised this and turned the power for my reference object back off again, everything started functioning as it should. Each emitted object now has it's own independent instance with it's own initial state.
So after you've been playing with your reference object: REMEMBER TO TURN IT BACK OFF! -
Can you not have 2 versions of the object that you want to emit? Version one is animated to appear and do the fins out animation then keyframe it to go invisible then replace it with version two that has no logic or animation and emit that one in the direction you want
-
I'm sure you could do that but that now seems unnecessarily complex compared to just using the emitter as intended,...now that I've actually figured out what I was doing wrong.
댓글을 남기려면 로그인하세요.