#Combination Lock/ Lockpad/ Valve - rotate the numbers by dragging the mouse

6 messages · Page 1 of 1 (latest)

frail berry
#

I am working on a First-Person-EscapeRoom.
For that i am trying to figure out how i could create a more dynamically moving Lockpad or Valve.
Just like in this video. Where the player rotates it smoothly.
https://www.youtube.com/watch?v=przI-LvM8RM&pp=ygULdW5pdHkgdmFsdmU%3D

This is a demonstration of the unity asset Manual Valve System made by Chilla's Art.

Check out more of our assets on:
https://assetstore.unity.com/publishers/33962

Twitter:
https://twitter.com/chillasart?lang=en

Our steam game:
https://store.steampowered.com/app/950400

▶ Play video
steady vine
#

is that the valve intro guy

haughty fossil
#

On which parts do you want help?

frail berry
# haughty fossil On which parts do you want help?

The mouse input is (x, y).

I want to translate it into rotation_input for the valve for example. And keeping it's orientation in mind.
So as a player i have make the mouse input intuivly based on how i am position to the valve.

haughty fossil
#

You need polar coordinates to do this kind of conversion. I'm too bad at maths to explain it in clear way... But it able you to calculate angles if you have an origin point (in a plane/2d world) and a coordinate.

#

Here some explaination, examples are in javascript, but the math apply anywhere. https://www.youtube.com/watch?v=O5wjXoFrau4

It’s finally time to dive into the trigonometric functions—sine, cosine, tangent—and take a close look at thinking in polar coordinates with p5.js! Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/3-angles/4-polar-coordinates

p5.js Web Editor Sketches:
🕹️ Basic Polar Coordinates: https://editor.p5js.org/codingtrain/sketches/DHet...

▶ Play video