Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Is there an action for particles in CopperCube. For example, like if I want a particle effect to start when an player shoots an enemy or when the player shoots an object. I'll like to know if this is possible in CopperCube |
||||
|
you could use this option.. child the fire with the object and when the object is hit ... show fire and then you can use do later hide fire. hope this helps |
||||
|
Yhh very nice idea but when I make the particle a child node and I publish the game(.exe), the particle does not show in the published version but when I don't make the particle a child node of the object, the particle shows in the published version. I really don't know how I can fix that. Note that there's no behaviour on the particle to make it disappear |
||||
|
There is an option in the shoot action that is action on impact. you can simply change unhide the particle and change the position of the particle relative to the position of the bullet. There is inbuilt example of particles in the engine, if you open that example project you will get to know that the clerk shoots a bullet and wherever that bullet collides it shows up the fire particle. Check out that example demo and you will be able to figure that out. Hope that helps. |
||||
|
Wow thanks @ just_in_case |
||||
|
It is possible to make a continuous particle, where there are no interruptions, I need to make a fire for a rocket. |
||||
|
Continuous? Do you mean fire from the back of the rocket?- Or continuous fire/explosion on the map, after the rocket hits the target?.... For smoke following a rocket - instead of attaching/childing the fire particles directly to the rocket, it's better to use the "follow" plugin instead - to make the fire particle-effect follow the rocket's-node. This will prevent the interruptions and make the particle effect look a lot better when it moves around and also allow you to move/hide/scale the rocket without affecting the direction/visibility/scale of the particles. Also, instead of using show/hide for particle effects, use "change scale" or "animate scale" instead. Changing the scale from (1 to zero) instead of simply hiding the particle effect, will make the animation smooth, instead of immediately clipping it short. Also, in the particle effect itself, select the "fade" option and set it to 1000ms or more and set the fade-target-value to be transparent (not opaque). This also smoothes out the fade transition when the particle effect is scaled to zero - instead of just instantly disappearing. Use all 3 for a perfect rocket trail - 1= Follow rocket (instead of child) 2= Scale node (instead of hide) 3= Use particle Fade for 1000ms If you just need a fire effect when the rocket hits the target (an explosion), do exactly the same thing described above - but instead of using "follow" in step 1, just use "change position" (of the particle effect) relative (0,0,0) to the target node when it hits the target node (using either "on proximity" for static nodes, or "action when hit" if using a node equipped with a game-character-behaviour). |
||||
|
And that's exactly what I need, where can I find this Follow plugin? |
||||
|
Hi b3_studio I can't remember where I got it from but here's the code (I modified it slightly) - to make it work, simply copy&paste the text into a text document - save it and rename it as "follow2.js" (make sure replace the .txt extension with.js), it must be named exactly correctly orcoppercube wont accept it - then place it in your "My Documents>Coppercube>Plugins>Actions" folder - back up your project and then restart coppercube. It would then be available as a script in Coppercube>Actions>ScriptedBehaviours>Follow2.... /* <behavior jsname="behavior_follow2" description="Follow2"> <property name="NodeToFollow" type="scenenode" /> </behavior> */ behavior_follow2 = function(){ } behavior_follow2.prototype.onAnimate = function(currentNode){ var curPos=ccbGetSceneNodeProperty(this.NodeToFollow,"Position"); ccbSetSceneNodeProperty(currentNode,"Position",curPos.x+3,curPos.y+4,curPos.z+0 ); } |
|