GithubHelp home page GithubHelp logo

object_gizmo's Introduction

Object Gizmo Module

This module exports a useGizmo function that enables manipulation of entity position and rotation.

Installation

  1. Download the object_gizmo resource.
  2. Extract the object_gizmo folder into your server's resources directory.
  3. Add start object_gizmo to your server's server.cfg file.

Export

exports.object_gizmo:useGizmo(handle)

Usage

Ensure the object_gizmo module script is running on your server.

The useGizmo export can be used in any Lua script on the client side as follows:

local handle = --[[Your target entity]]
local result = exports.object_gizmo:useGizmo(handle)

result will contain the entity handle, final position, and final rotation.

Test Command

This module includes a test command testGizmo that demonstrates how to use the gizmo.

The command creates an object at the player's location and then activates the gizmo for that object.

local model = `prop_mp_cone_02`
RegisterCommand('testGizmo', function()
    local offset = GetEntityCoords(cache.ped) + GetEntityForwardVector(cache.ped) * 3
    lib.requestModel(model)
    local obj = CreateObject(model, offset.x, offset.y, offset.z, false, false, false)
    local data = exports.object_gizmo:useGizmo(obj)

    lib.print.info(data)
end)

Controls

While using the gizmo, the following controls apply:

  • [W]: Switch to Translate Mode
  • [R]: Switch to Rotate Mode
  • [S]: Switch to Scale Mode (if enabled)
  • [Q]: Switch between Relative and World
  • [LAlt]: Snap To Ground
  • [Enter]: Finish Editing

The current mode (Translate/Rotate) will be displayed on the screen.

Note

The gizmo only works on entities that you have sufficient permissions to manipulate. Make sure you have the correct permissions to move or rotate the entity you are working with.

object_gizmo's People

Contributors

demigod916 avatar github-actions[bot] avatar

Stargazers

Matthias avatar Mr.Crowley avatar Nistor Constantin-Flavius avatar Abyss avatar Rashid avatar Ilham Wicaksono avatar ViskCY avatar NethushDev avatar Ashen Etugala avatar GoldO avatar Nitipoom Aumpitak avatar deFuzz avatar  avatar Léo avatar Jaime Rodrigo avatar  avatar  avatar  avatar Raed Jendali Refai avatar Yamada Taro avatar ST4LTH avatar daggre_actual avatar Sober avatar Jatin Kadian avatar Emir Kibar avatar Stache Noisy avatar  avatar Keegan avatar vipex avatar TALAT avatar Dione Batista avatar Zerio avatar gamenew09 avatar  avatar Boren avatar  avatar KateMadison avatar  avatar Csoki avatar Recon avatar Mike Gedzius avatar Ceeb avatar mockdot avatar Eivor avatar Jellyton avatar Marco Sendner avatar Zemo avatar Drao avatar Karl avatar enty avatar Thijmen avatar r4venw avatar  avatar  avatar voyak avatar Gergő avatar Nedwons avatar hadir avatar EXE avatar tkM avatar Outsider avatar MrNewb avatar Marcel avatar Dogo-Lab avatar Petr Koukal avatar Vegard m'Bendiktsen avatar Bostra avatar Diogo Santos avatar

Watchers

 avatar daggre_actual avatar

object_gizmo's Issues

[Feature] UI showing the Coords

Possibly a UI that shows the Coordinates and Rotation being able to put in coordinates that's configurable to toggle on and off in the config or keybinding

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.