πΎπ¦πππππ ππππ₯
β
[SOLVED] Does the 3rd line of code hold memory as a reference or does it hold the actual value?
ayooo, quick question. pretty simple. Book is a custom class just so you know....
just holds the memory of the location in terms of reference for the value or object
holds the actual value of course
holds what??? the memory of the value location or is it considered to hold the actual value as well?
10 replies
β Question About ParticleEffects in Unity/C#
So right now, im only a couple weeks into C#/GameDev. Im working on a tiny little project to try to get an understanding of where things go and when. The game is a basic 2D rocket league type deal with simple stuff like boosting and driving ofc. Im currently trying to add a particle effect WHILE boosting. I thought maybe a simple...
if (!boostEffect.isPlaying && Input.GetKey(KeyCode.Space))
{
speed = boostSpeed;
boostEffect.Play();
}
else if (boostEffect.isPlaying && Input.GetKeyUp(KeyCode.Space))
{
speed = resetSpeed;
boostEffect.Stop();
}
would work buttt...my 1st issue was the delay in animation which i managed to get working. Now my issue is getting it to STOP immediatly after letting up on space bar. If i use looping, i mean itll just keep going, if i turn it to no looping, then duration becomes the issue. Ive tried setting duration to 0 but it sets it to 0.05 and it being even that, causes the animation not to play at all.
So my question is, for a "While holding a button" type particl effect, is this just completely wrong? Any tips or pointers on how to write it correctly for such an instance?
P.S - If you happen to know a good udemy course perfect for getting a good grasp on C#(preferably gamedev related) i would love to know it. Thanks!
2 replies