Search Unity

Rotate the floor on the Direction that the Player's Facing!

Discussion in 'Scripting' started by wassim-s-haddar, Mar 9, 2019.

  1. wassim-s-haddar

    wassim-s-haddar

    Joined:
    Apr 21, 2017
    Posts:
    15
    Hello, I'm trying to figure out how to rotate the floor on what direction the player is facing, I would really appreciate the help!
    FloorRotation.png
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @wassim-s-haddar

    "how to rotate the floor on what direction the player is facing"

    Do you mean that floor changes only it's heading based on player facing direction?

    Or that floor rotates along x-axis and z-axis, depending on player's heading, like in some tilting maze puzzle?

    Based on your image, it looks like you would want to rotate the floor along x- and z-axis somehow.
     
  3. wassim-s-haddar

    wassim-s-haddar

    Joined:
    Apr 21, 2017
    Posts:
    15
    @eses Yeah Exactly like this example,

    But Instead of moving just the floor the rotation have to be based on the direction that the Player's facing!
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi again @wassim-s-haddar

    I'm not exactly sure what you are after, and fail to see it in your video. Usually tilt maze puzzles go the other way...

    1. User tilts the table using knobs.

    2. Knobs tilt the table along two axis. In this case tilting is controlled by keyboard or by tilting a device.

    3. Player object / ball moves towards tilt direction based on gravity and angle of the table.

    And this is what happens in your video.
     
  5. wassim-s-haddar

    wassim-s-haddar

    Joined:
    Apr 21, 2017
    Posts:
    15
    @eses Basically the Main Character view is like a Third Person Controller, Would it be possible to Tilt the Platform based on the Player's direction?
    Thanks for your help!