PlayerMouse

非推奨を表示
作成できません

The PlayerMouse behaves identically to the Mouse object that is obtained using Tool.Equipped. It can be accessed from LocalScripts using the local player's Player:GetMouse() method. Both PlayerMouse and Mouse are legacy APIs, superseded by UserInputService.

The only difference between the PlayerMouse and the Mouse object is the PlayerMouse can be obtained using the Player:GetMouse() method.

In most cases developers are advised to use the new UserInputService. However the PlayerMouse and Mouse objects remain supported for a number of reasons. See Input and Camera for more information on customizing inputs in your experience.

コードサンプル

PlayerMouse

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local function onMouseMove()
print("mouse screen position: ", mouse.X, mouse.Y)
end
mouse.Move:Connect(onMouseMove)

概要

プロパティ

Mouse から継承した プロパティ
  • 読み取り専用
    複製されていません
    並列読み取り

    The CFrame of the mouse's position in 3D space.

  • 並列読み取り

    The content ID of the image used as the Mouse icon.

  • 読み取り専用
    複製されていません
    並列読み取り

    A CFrame positioned at the Workspace.CurrentCamera and oriented toward the mouse's 3D position.

  • 読み取り専用
    複製されていません
    並列読み取り

    The object in 3D space the mouse is pointing to.

  • 並列読み取り

    Determines an object (and its descendants) to be ignored when determining Mouse.Hit and Mouse.Target.

  • 読み取り専用
    複製されていません
    並列読み取り

    Indicates the Enum.NormalId of the BasePart surface at which the mouse is pointing.

  • 読み取り専用
    複製されていません
    並列読み取り

    A Ray directed towards the mouse's world position, originating from the Workspace.CurrentCamera world position.

  • 読み取り専用
    複製されていません
    並列読み取り

    Describes the width of the game window in pixels.

  • 読み取り専用
    複製されていません
    並列読み取り

    Describes the height of the game window in pixels.

  • 読み取り専用
    複製されていません
    並列読み取り

    Describes the X (horizontal) component of the mouse's position on the screen.

  • 読み取り専用
    複製されていません
    並列読み取り

    Describes the Y (vertical) component of the mouse's screen position.

イベント

Mouse から継承した イベント

プロパティ

方法

イベント