#Help with Telekenesis
1 messages · Page 1 of 1 (latest)
As you can see, the pig floats upwards to it's destination location, but at one point it crosses it and keeps going. I'd like to try and make the pig float up, and stop near the destination without it drifting further.

set {_v} to vector from {_e} to {_loc}
set {_v2} to vector from {_loc} to {_e}
set vector length of {_v} to (distance between location at {_e} and {_loc}) / 10
set vector length of {_v2} to (distance between location at {_e} and {_loc}) / 11
push {_e} {_v}
push {_e} {_v2}
Runs every tick.
[!] the entity has the {noGravity:1b} NBT tag enabled.
I assume you are doing it in a function, please post all the code to understand it better.
Not just that piece
function pushEntity(e: entity, loc: location):
set {_v} to vector from {_e} to {_loc}
set {_v2} to vector from {_loc} to {_e}
set vector length of {_v} to (distance between location at {_e} and {_loc}) / 10
set vector length of {_v2} to (distance between location at {_e} and {_loc}) / 11
push {_e} {_v}
push {_e} {_v2}
while amount of {kw.storage::levitateTargets::%{_p}%::*} > 0:
send action bar "looping.." to {_p}
loop {kw.storage::levitateTargets::%{_p}%::*}:
if {kw.storage::levitateMode::%{_p}%} is "free":
pushEntity(loop-value,{kw.storage::levitatePosition::%loop-value%})
wait a tick
{_p} = player
{kw.storage::levitateTargets::%{_p}%::*} is a list of entities i'm levitating.
Is this enough info provided.?
Yeah, wait a minute while I try something.
Gotcha.
Feel free to ping me when you got anything. I'll be able to respond faster.