Leadwerks Game Engine
Questions about units
I may be doing something wrong, but when I use SetPosition I am encountering two problems.

1. First it seems to be setting the position of the object *relative* to the original position of the object, rather than simply placing it in the coordinates I put in.

2. It seems to be using a different scale, so if I wanted to move something 100 units on the grid, I would need to put in (0,0,1) instead of (0,0,100).

I am trying to simply change/set the position of the character entity when I load a map. The script works otherwise, it's just not putting the character exactly where I want it to go.

Is there another command like SetPosition that can place an object in an exact position on the grid?
< >
Сообщения 13 из 3
Okay, sorry I figured it out. SetPosition does absolute coordinates, but the units simply need to be divided by 100, as compared to what is shown in the level editor.

So if you wanted to set an object to position 100,100,100 (as it would be shown in the editor) you would need to use self.entity:SetPosition(1,1,1)

This is working for me. But if there is a better way to do it let me know.
Автор темы посчитал это сообщение ответом на свой вопрос.
Leadwerks Software  [Разработчик] 20 дек. 2023 г. в 20:22 
In the editor, units are shown as centimeters
It might be good to add this information somewhere under SetPosition in the documentation. Or include a page on "Units" or something.
< >
Сообщения 13 из 3
Показывать на странице: 1530 50

Дата создания: 20 дек. 2023 г. в 7:56
Сообщений: 3