#Smoke Triggers Player
1 messages · Page 1 of 1 (latest)
What the heck how did this happen
click any message in discord, create thread
wat dang that's awesome
yeah, less clutter
so just re-define your entire issue here
State what you are trying to achieve
post code and inspector stuff
would you like git?
nah
mkay
just make it easy for people to pick up on the issue in the thread
ya
afk a bit
np i greatly appreciate the help.
The player OnTriggerEnter2D is not detecting the particle triggers shown here. I'm simply trying to get the triggers to flip a bool on the player for now.
Here's the trigger module on the particle system
I decided instead of a write up I was going to make a few copies with different settings, put debug logs in all potential methods on player, and try a bit more
I have an idea
are you working with 2D or 3D colliders, or both?
If I recall correctly, 2D and 3D cannot interact with one another
Particle System can be set to 2D, but I forget how
try Burst Spread in the Emission module
or just add a 3D collider to the player
I actually noticed this. Collision has 2D option, trigger does not. Trigger shows spheres as you point out.
already using 2d collider for tilemap tho
should be safe to add a 3D Collider with isTrigger true to the player
you might want 3D particles anyway
unity litearlly won't allow it
There should be a simple solution to this.
Like making the Particles 2D
or you can create a child game object with a 3D collider
but maybe try OverlapCapsule
should be a quick fix
I'll try that next thanks
using UnityEngine;
public class DeltaCounter : MonoBehaviour
{
private float frequency = 1.0f;
private float timer;
private void Update()
{
timer += Time.deltaTime;
if (timer >= frequency)
{
timer = 0f;
MyFunction();
}
}
private void MyFunction()
{
// Hello, World!
}
}
That there is a good way to not run heavy functions each and every visual frame
it's like a Coroutine, but without the added background garbage
frequency is how often you want it to run
every 1.0f sec
yeah that's how I did my over time methods for the fog degen / regen
i couldn't figure out the overlap collider thing
using System.Collections.Generic;
using UnityEngine;
public class PlayerStats : MonoBehaviour
{
public int _smokeBuildup = 0;
public bool _smokeBool = false;
private float _reductionRate = 1;
private float _damageRate = 1;
private float _timer;
private void Update()
{
if (_smokeBool = false && _smokeBuildup > 0)
{
SmokeReduction();
}
if (_smokeBool == true)
{
SmokeDamage();
}
}
//Desperately trying to get smoke to register xd
private void OnTriggerEnter2D(Collider2D col)
{
Debug.Log("Collider Entered!");
if (col.tag == "Smoke")
Debug.Log("smoked!");
}
private void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log("Collision Detected!");
}
private void OnParticleTrigger()
{
Debug.Log("Trigger Detected!");
}
//reduce smoke buildup over time if not colliding
public void SmokeReduction()
{
//Why can't this _timer variable be local? Just curious.
_timer += Time.deltaTime;
if (_timer >= _reductionRate)
{
_timer = 0f;
_smokeBuildup--;
Debug.Log("Smoke Building Up: " + _smokeBuildup);
}
}
//increase smoke buildup over time
public void SmokeDamage()
{
_timer += Time.deltaTime;
if (_timer >= _damageRate)
{
_timer = 0f;
_smokeBuildup++;
Debug.Log("Smoke Reducing: " + _smokeBuildup);
}
}
}
not sure exactly how I'd put it in there
hmm
try this
go to Particle System -> Collision
What is the Collision Mode ?
hm wait, it's different now
and reminding myself - trigger, not collider
yeah. Though the player pushing the emission around is kinda cool
kk
I spent weeks before trying to comprehend the particle system
just wait till you get to VFX Shader Graph 🤣
I have not used it yet, but it's as beautiful as it is complex
I been using both SG and VFX a bit tbh
I like the VFX graph
easier to comprehend
xd
lol
good to hear
I have too many different things on my mind.
Looking forward to some nice caffeinated evenings with VFX
once I have other stuff in order
yes, me helping people is me procrastinating my own problems
but for now it's constructive ^^
It's beautiful tbh, the vfx stuff
yeah I know, I just hope it also runs well
would hate to waste 10 hrs only having to make it 1/10th complex later
I'm on integrated intel laptop graphics and had 1000000 particles goin
wow, nice
ye
there is hope
was making silly ball things galaxy things
dark magic to destroy stuff, good times
the graph tho for connecting all the ways you want things to go is so niiice
yeah it's like Bolt, visual scripting
seems more effective to do it that way as well
I play with midi data in unity
so a software playing drums, or turning synthesizer knobs, also is my data for VFX variables
SUUUUPER fun.
anywho. i'll bbl. I think i'm gonna nap
or sleep all day tbh
i'm nocturnal now 😿
Sounds interesting, like you could make your own music visualizations
I think I'll look into that some time ^^
Let me know if you find a solution to this thing. I want to write it down 😂
Since this is public, here's the github incase anyone looks for my problem here https://github.com/bigggmoustache/very-cool-game-project