#Collision not working

1 messages · Page 1 of 1 (latest)

honest sinew
#

"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

clever pier
#

So you need to check the other things in the guide

honest sinew
#

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??

clever pier
#

Take screenshots of the relevant object's inspectors.

honest sinew
#

I set Collision Detection
to Continuous and collision still does not happen

clever pier
#

Ok, then take a screenshot/video of when the objects supposed to collider with gizmos visible.

honest sinew
#

ok

clever pier
#

Gizmos of both objects including the colliders outline. You might need to select them in the hierarchy for the gizmos to be visible

honest sinew
#

I have a Deactivate method in snowball animation (attached to last frame of explosion animation), could it be the cause?

clever pier
#

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

honest sinew
#

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 ?????????

clever pier
#

🤷‍♂️

#

But it works now, right?

honest sinew
#

Ok, nope it broke again. Now when i played it again to record it, beet disappears before colliding with snowball

clever pier
#

beet?

honest sinew
#

(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

clever pier
#

No clue. You'll need to debug that.

honest sinew
#

Ok, reloading fixed it

#

Now the monster randomly goes to that specific spot after some time

clever pier
#

Possibly. Disable the ai and see if that happens.🤷‍♂️

honest sinew
#

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??

clever pier
# honest sinew

Take screenshots like these again, but with collider components expanded.

clever pier
honest sinew
clever pier
#

I can't see their settings on your screenshots.

#

*photos.

#

They should really be screenshots btw

honest sinew
#

I am using remote desktop, the screenshot with keyboard does not work, lets see, i will try to figure it out

clever pier
#
  1. You have 3 errors in the console.
honest sinew
#

Now only one shows up

clever pier
honest sinew
#

hmmm

honest sinew
clever pier
#

Ok maybe it's not relevant. Not sure.

honest sinew
#

Seems a bit too advanced for me :, )

#

man, where do i even look for solutions for astar???

clever pier
honest sinew
#

ok, i will try. I wonder if collision detection is fixable

clever pier
#

it is for sure. You just need to debug.

honest sinew
#

Hmmm, I should try debugging collision detection code?

clever pier
honest sinew
#

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.

honest sinew
#

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...

honest sinew
#

Cant find anything on pathfinding, the error is NullReferenceException: Object reference not set to an instance of an object.

clever pier
#

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

honest sinew
#

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.