≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
how to make bullet parabola
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b]VP[/b] wrote: Hi, I have a (partial?) solution for webGL... you can use a particle generator to create the "illusion" of a realistic-looking parabolic bullet. Add a png for the bullet. Rotate the x axis by 180 degrees (so it shoots downwards, instead of upwards). Set particle emission to 1 particle per second (min and max), set the node to invisible. Now when you shoot, select the particle generator as the bullet. When you test, the particle gen will start each time it's clones as a bullet - you will see the bullet moves downwards as it travels forwards (giving the effect of a parabola). The problem is that the particle only appears after 1 second. To get round this (see my TankRescueGame), you can simply add a second shoot command.... make a second bullet node (just a simple static node - no particle gen), and set it to invisible. Add a new shoot action at the same time as the first shoot action (so it's shooting 2 bullets at the same time). Set the range of this second bullet and set this second bullet so it disappears after 1 second. Now when you shoot, the first bullet will appear for 1 second ( and fly straight), the second bullet "seamlessly" appears after 1 second, and travels on an arc. This gives a perfect illusion of the bullet flying in a parabola. *You will need to tweak the "range" of the static bullet node to get the timing seamless (otherwise you will see the 2 bullets). The issue obviously is that it's only an illusion (the bullet is actually flying straight). The second issue is that the bullet has to be visible for at least 2 seconds before you really notice the parabolic curve (due to the particle generator). It's not perfect, but will work as a last resort - if you can't find a better solution. This is the option I went for in my game - it was driving me insane - I went through about 15 different methods - all worked to some degree but I settled on this in the end because I only needed it as a visual effect. Here's the ccb file for you as an example (first file is the gae.exe, second file is the game.ccb source-code).... I think I put the bullet mechanics on the "tank turret" node: [url]https://veganpete.itch.io/jungletank[/url] I'll keep trying. If I can think of a better method, I'll post it here.[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact