#generic_Thread_Name
1 messages · Page 1 of 1 (latest)
Okk
now before i say anything I do have to warn you Im also more on the beginner side of things
Okk
now you can use
void OnTriggerEnter2D
{
//stuff goes here
}
``` to activate code when the collider is triggered
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/, https://scriptbin.xyz/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
okk
i mean it looks like you have most of this figured out
just mess with the rotation a bit
Yeah but I can't invert the rotation
And I tried many things
Wait I'll show you the problem
could u show me the script ur using to rotate the object?
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
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
How might I do that
Well google how to make a seesaw in unity