#generic_Thread_Name

1 messages · Page 1 of 1 (latest)

bleak plover
#

lets just move onto this thread

prime grotto
#

Okk

bleak plover
#

now before i say anything I do have to warn you Im also more on the beginner side of things

prime grotto
#

Okk

bleak plover
#

if you add a collider component you can use it as a trigger

prime grotto
#

Yeah so this is where I'm at

bleak plover
#

now you can use

void OnTriggerEnter2D
{
//stuff goes here
}
``` to activate code when the collider is triggered
bleak plover
lofty badgeBOT
prime grotto
bleak plover
#

just mess with the rotation a bit

prime grotto
#

Yeah but I can't invert the rotation

#

And I tried many things

#

Wait I'll show you the problem

bleak plover
#

could u show me the script ur using to rotate the object?

prime grotto
#

sharing the code 1 sec

hasty willow
#

You need a way to determine what side of the platform you hit right? A little bit of vector math will help here. First get the collision point, then calculate the direction from that point towards the centrr/pivot of the object. Then do a dot product of that direction and the correct transform axis(probably transform.right) then you have your answer if it negative it on one side and if the result is positive it is in the other side

#

But if you want to simulate physics like that then use the physics engine

#

Seems to me you want actual physics

prime grotto
#

Yeah so right now Im checking if the object on collision is on the right or left of the coloumn's Transform x. And then I'm having a weight difference give me a positive and negative value to determine if I want to rotate clockwise or anti clockwise

#

But I want it to be the other way round than it is now, So I was trying to multiply it by a negative or change it but when I do it keeps jittering, That's the problem I want to fic

hasty willow
#

Well google how to make a seesaw in unity

prime grotto
#

Yoo I got it @hasty willow @bleak plover Thank you so much!