#weird issue

1 messages · Page 1 of 1 (latest)

compact anvil
#

Why is this happening:

#

This was the code:

violet field
#

Because location 0 0 0 is not loaded

compact anvil
#

But it can't be 0,0,0

#
        let first = currentLoc[0];
        let second = currentLoc[1];
        let third = currentLoc[2];
        let rotation = 0 //yaw
        let degree = 180 - rotation + 180 - Math.atan2(second/-third);
        let xvalue = Math.cos(degree) * Math.sqrt((second * second) + (third * third));
        let yvalue = Math.sin(degree) * Math.sqrt((second * second) + (third * third));
        let FinalVec = Vector.add(parseVector({
            x: first, y: yvalue, z: xvalue
        }, entity.getViewDirection()), entity.location);```
#

It does have an pass vector function too, it did work when I just used the not rotated offset

#

But since I tried to rotate the offset it doesn't work anymore even though it shouldn't change anything

compact anvil
violet field
#

Where's line 264?

compact anvil
#

Is where the entity spawns

violet field
#

Show the code

compact anvil
#

The whole?

#

Alr

#

There you go

wraith snowBOT
#
Program Output
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use ​`node --trace-warnings ...​` to show where the warning was created)
/home/jail/prog.js:1
import {
^^^^^^

SyntaxError: Cannot use impor
compact anvil
violet field
#

Seems looking fine, idk why it's got error

compact anvil
#

Whyyy

#

What to do now

#

@violet field

#

What does NaN mean again?

violet field
#

Not a number

compact anvil
#

Wtf

#

Atan2 seems to be weird

violet field
#

Probably you didn't turn string into number

compact anvil
dusty oasis
#

maybe there is something wrong with Math.atan2, because the way it is declared is like this Math.atan2(x, y)

#

try changing Math.atan2() to Math.atan()

compact anvil
#

Oh, alr

#

But the value it gives me is wrong

#

@dusty oasis

#

Was something like -2.7...