π”Ύπ•¦π•”π•”π•šπ•‹π• π•šπ•π•–π•₯
π”Ύπ•¦π•”π•”π•šπ•‹π• π•šπ•π•–π•₯
CC#
Created by π”Ύπ•¦π•”π•”π•šπ•‹π• π•šπ•π•–π•₯ on 11/17/2023 in #help
βœ… [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....
Book bookLocation = new Book();
Book bookLocation = new Book();
just holds the memory of the location in terms of reference for the value or object
bool falseValue = false;
bool falseValue = false;
holds the actual value of course
bool anotherFalseValue = falseValue;
bool anotherFalseValue = falseValue;
holds what??? the memory of the value location or is it considered to hold the actual value as well?
10 replies
CC#
Created by π”Ύπ•¦π•”π•”π•šπ•‹π• π•šπ•π•–π•₯ on 2/23/2023 in #help
❔ 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