Jump to content

[Solved]Turn colshape


Memory

Recommended Posts

Posted (edited)

Hello guys,

how can I set rotation for colshapes? SetElementRotation didn't work.

Edited by Guest

Ingame name: [sV]Kostya

Name in scripts: Kostya

Posted

Example, look to image, I want to turn the colshape on few degrees.

example.jpg

I want make parking in the colshape.

Ingame name: [sV]Kostya

Name in scripts: Kostya

Posted
It automaticly calculate that when you insert the positions.

?

i think you need to use:
createColPolygon 

Yea, I know about this, but it 2D :(

Ingame name: [sV]Kostya

Name in scripts: Kostya

Posted

Polygon is infinite upward, but I needn't it. Okey, back to SetElementRotation, why it doesn't work for colshapes, colshape is element.

Ingame name: [sV]Kostya

Name in scripts: Kostya

Posted

That's for simplicity of collision detection. It's easier to check if x < 10 and x > -10 then calculating the rotation and then collision. The colshapes are simple primitives (box, sphere, rectangle, etc.) It takes very little time to check if point XYZ is inside a box or rectangle, same with sphere; simply checking the distance between 2 points and comparing it with the radius of sphere.

You can use createColPolygon and additionally, onColShapeHit check the Z axis.

Posted
...

You can use createColPolygon and additionally, onColShapeHit check the Z axis.

Yea, I already thinking about it and probably will do so. Thank you :)

Ingame name: [sV]Kostya

Name in scripts: Kostya

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...