Object size increase in game
Is it possible to emmitt an object that gets bigger intill in touches somthing. I want tk recreate a game called orbital on the iphone
-
Put a microchip on the object.
Inside the microchip you can place an impact sensor, a switch, and a timeline.
Wire the "bumps" output on the impact sensor into the left side of the switch. Make sure the switch is on by default. Wire the switch output into the power on the timeline.
In the timeline, place 2 keyframes. 1 on each end. The first should be the object at minimum size. The second should be the object at maximum size. You'll need to set a blend by pressing X over the gap between them. I would suggest a linear blend. Adjust the length of the timeline depending on how long you expect it's needed. Make sure you pull the end of the timeline back against the last keyframe so no gap exists after it.
Then, theoretically, the object will grow until a bump shuts the timeline off. As long as the timeline is on "sustain" (which is the default), it should keep it's size. Of course if it's bumped again, the timeline will turn back on. If you don't want that, you can also wire the output of the switch into the power on the impact sensor, so it will turn itself off.
I haven't tested this though. Some fine tuning may be necessary. You may find you get better results with a tag and trigger zone setup rather than the impact sensor, depending on the scene setup.
EDIT: Make sure you tweak the keyframes to "Keep settings", otherwise the object will revert in size when you power the timeline off. -
AndymationB has some good ideas, though I see a couple of bugs that may be problematic. Here is a slightly different way of doing it based on the same principles:
Add an impact sensor to the object, and use its "touching" output (this will work similarly to the "bump" output but will continue to send a signal while touching something).
Add a selector to track the current state of the logic. A selector has may channels, outputs a signal from only one of those outputs at a time, and allows you to set which channel is the current "active" one. It will not change which channel is active until some logic changes it. It defaults to channel A, so we'll use that to trigger the growing logic.
Add a timeline, with the same setup as AndymationB explained. Leave it powered all the time.
Add a timer, set it to "speed" mode; this will allow you to send a signal into the "play" input which will set the speed time passes for that timer. So if you send it an "on" (1) signal, it will play at the normal speed. If you send it an "off" (0) signal, it will pause entirely. You can even send it a negative signal to make it go backwards, but we won't need that here.
Wire channel A into the timer's "play" input. Open the timeline, and wire the timer's "output" into the *bottom* of the playhead. This will set the playhead's position through the timeline based on the value being sent to it. 0 means the start of the timeline, and 1 means the end of the timeline. So here, the output of the timer will give a value between 0 and 1 based on the progress made towards the target time; you can adjust the target time to change how long it will take to get to the end of the timeline. In this case, this means it will grow the object while the timer increases and will stop growing when the timer is paused.
Now take a wire from the impact sensor's "touching" (or "bump" if you prefer) and plug it into the selector's channel B input. When it receives a signal, it will make channel B the active channel, and no signal will be sent from channel A anymore. So here, when the object is touching something, it will change to channel B, and stop growing. But the timer and timeline will still be powered so it will remain paused at whatever size it currently is. And, as you've got no logic setting it back to channel A, it'll never go back to growing and will stay that size forever.
So an overview of what's happening is: In state A, the object will continue growing over time to some maximum scale. When the object first touches something else, state A will stop which stops the object from growing any further.
Hope this helps.
@AndymationB: I'm not sure what you mean about the switch. A switch will just send on an "on" signal while receiving an on signal, and an "off" signal while receiving an off signal; it wouldn't really do much in this case I don't think.
Also, the issue with the timeline is that it has to stay powered for the keyframes to continue affecting the object. But then it will continue playing.
(See above for amendments to your solution.) -
As you pointed out, the impact sensor would only send a pulse in my setup, so the switch would give a continuous off afterward. There are plenty of other ways of getting the same effect (counters, selectors, freezing a signal manipulator, etc.), but I would guess that a switch is the cheapest thermo wise.
I didn't think the touching output would be any more useful since the emitted object is likely to bounce a few times.
Good call about the timeline power off. I forgot to mention that the keyframes should be set to "keep changes", in which case the size change will remain even after the timeline is off. -
'@Andy: I tried starting a chat with you but couldn't for whatever reason. Not understanding what you mean about the switch, as it will not change the value carried by a wire plugged into it, so it has no effect. Unless there's something I'm missing. Feel free to get in touch through PSN text chat; I don't want to clog this thread up too much XD
-
OK, I owe a significant Mea Culpa here. The truth is, I always use counters for these kinds of state changes, and then yesterday I was perusing some advanced logic made by people who have actually studied this kind of stuff, and it appeared as though they were using switches instead. Clearly my interpretation was completely wrong. And, rather than testing this myself, I just assumed that I was misusing counters, and that switches were the correct way. Ugh! Lessons learned.
I have a bit of a grudge against selectors, because I once spent like two hours trying to figure out why one was ruining my whole scene (turns out I had cloned one while it wasn't in state A, and from then on the clone started the scene in the other state, which was making everything behave unexpectedly).
So in this instance, I would use a full counter, and wire the impact sensor into the minus input of the counter. (Because selectors can eat it!)
@Supposer I did not receive a PSN message. I probably don't have it set up right, because I never use them. But you, or anyone else here, can email me at andymationb@gmail and I'll be happy to talk about all things dreams until the cows come home. -
Thank you guys for all your guidance
Im sure i can get somthing working now
Thanks again -
Iv managed to get an object to grow in size and it also stops when it contacts a duplicate of its self or another object
Thing is that it wont change its size on the spot where it was emmitted to
Think it has somting to do with the keyframe
Iv tried emmiting a separt object which the growing object can emmitt from but that has same effect
Please sign in to leave a comment.