#Collision not working
1 messages · Page 1 of 1 (latest)
"Using transform.position to move objects bypasses the physics simulation step." is my issue it seems. Although I used rb.addforce to move object on the path, i used sr.transform.localPosition to flip the beet so it faces the right directions. (The reasons why is because I could make only transform work)
Hmmm I commented all parts with transform and collision still does not happen
Ok, i tested the collision code on static object and its not working TT
This would only cause the collisions to not work "sometimes", so it's probably not the main issue in your case.
So you need to check the other things in the guide
Hmmm
I checked everything else, maybe I need to set the rigidbody's Collision Detection mode to Continuous Dynamic
Since the Snowball is pretty fast??
Take screenshots of the relevant object's inspectors.
I set Collision Detection
to Continuous and collision still does not happen
Ok, then take a screenshot/video of when the objects supposed to collider with gizmos visible.
ok
Gizmos of both objects including the colliders outline. You might need to select them in the hierarchy for the gizmos to be visible
I have a Deactivate method in snowball animation (attached to last frame of explosion animation), could it be the cause?
How do you know when to explode it?
how do you trigger that animation?
And yes, that might be a problem
comment out that line and see if you have a collision
ok im goint to comment it out
Ok weird thing happend
I commented out deactivate and animation staerted looking weird, triggerin explosion on mouse click, but then, i put deactivate in back as it was and....... collision works now?????
what
I did not change script what happened ?????????
Ok, nope it broke again. Now when i played it again to record it, beet disappears before colliding with snowball
beet?
(That red monster thing)
Now for some reason beet location changes
???
Ok this is very weird, why the beet location just changes
In previous video you can see that monster is going left and right on its path, but now, for some reason the monster goes higher???
Im going to reload unity real quick somethings weird
No clue. You'll need to debug that.
Ok, reloading fixed it
Now the monster randomly goes to that specific spot after some time
Maybe A* is glitching out ?? Same code as before but this stuff happens now
Possibly. Disable the ai and see if that happens.🤷♂️
Yep, its the AI
btw, even with disabled deactivation on snowball, beet still does not detect collision it seems
Looks like something broke but it worked before, why it broke now??
Take screenshots like these again, but with collider components expanded.
No clue. Depends on your pathfinding implementation.
collider components expanded?
I can't see their settings on your screenshots.
*photos.
They should really be screenshots btw
I am using remote desktop, the screenshot with keyboard does not work, lets see, i will try to figure it out
Ok
- You have 3 errors in the console.
Now only one shows up
Now only this error pops up https://hastepaste.com/view/T3h1
I'm not sure if it's relevant or not(can't see the whole callstack in the error), but it might be related to your pathfinding.
hmmm
https://hastepaste.com/view/T3h1 I pasted error here
Ok maybe it's not relevant. Not sure.
Seems a bit too advanced for me :, )
man, where do i even look for solutions for astar???
On their website/github/community? Or try to debug on your own.
ok, i will try. I wonder if collision detection is fixable
it is for sure. You just need to debug.
Hmmm, I should try debugging collision detection code?
Yep. Debug whatever you think the cause of the issue is.
hmm, I cant figure it out, with deactivate disabled explosion animation starts to play (collision does not happen). When the disable is enabled, collision does not happen either, im stumped.
I fixed it! i threw away Collider collision! and just added some code in snowball ontriggerenter2d!
now the only issue i have is broken pathfinding...
Cant find anything on pathfinding, the error is NullReferenceException: Object reference not set to an instance of an object.
If it's the same error as before, ignore it for now. It seemed to be related to editor loop.
focus on debugging the pathfinding
tbh, I am so new to c# that probably just remaking everything will be easier for me. It worked before.. (T_T) I will try again tomorrow.