Scripts / [SOLVED] SetPosition. Not working?

Author
Message
Mortt
4
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 10th Aug 2020 13:17
Hi.
Does using for example, SetPosition(e, 25600,600,25640), need some special criteria to work. It is not only SetPosition that does not work but eveyone. AIEntityGoToPosition(obj,x,y,z), AISetEntityPosition, SetPosition, ResetPosition, PositionObject and so on. I must be dooing something wrong, but cant fathom it out.

I am trying to move a barrel from one place to another place.
It just does not work. Is this only to move player? How is it possible to move a barrel or some other object/entity from one place to another?
I am sure that it used to work, but im stuck.
Any help would be good please.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 1050 Ti 4GB. Dell US27 2560 x 1440. Dell 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card

The author of this post has marked a post as an answer.

Go to answer
PM
GubbyBlips
2
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 10th Aug 2020 16:06 Edited at: 10th Aug 2020 16:08
This post has been marked by the post author as the answer.
CollisionOff(e)
in script before the line for SetPosition---
I think the ResetPosition moves the "collision box" of the entity--
so turn collision off, move it, and turn collision back on;

CollisionOff(e)
SetPosition(e, 25600,600,25640)
ResetPosition(e, 25600,600,25640)
CollisionOn(e)
PM
smallg
Community Leader
15
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Aug 2020 19:49
^ what he said but also if you are moving an object a large distance or it is not near the player you may need to turn it to always active = yes
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Mortt
4
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 10th Aug 2020 20:36
Fantastic.
CollisionOff(e)
RestPosition(e, 25300,600,25640)
PositionObject(obj,25300,600,25640)
CollisionOn(e)
It is instant.
Thanks so much you guys.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 1050 Ti 4GB. Dell US27 2560 x 1440. Dell 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card
PM

Login to post a reply

Server time is: 2021-01-28 06:00:58
Your offset time is: 2021-01-28 06:00:58