Bug Report/fault: Arc tangent not working when something sets position to object SOLVED, Unusual alter in code


#1

It's just an annoying bug.

Here:
I was using arctan: one block facing the other

The block that used arctan (which was facing the other one) has a text set to its position, repeated forever.

Arctan doesn't work from this :rage:

By the way, does anyone know how to use arctan so that the object facing another doesn't angle to it, the only angle reference is when it moves forward, it moves in the direction of the object it is "facing"?


#2

@ThinBuffalo, do you know?


#3

Sure, I can think of 2 ways off the top of my head

  1. Just don't set the object's Angle the calculated angle. Set another reference angle instead. Let's call it theta. Then you use Set Position and calculate the new position using Cos/Sin and theta.

  2. If you need or would rather use Set Angle and Move Forward, use 2 objects, one of which is invisible. Use the invisible object with the Set Angle & Move Forward. Continually set the visible object's position to the invisible object's position. Sounds like this is what you were trying to do?


#4

That is what I just did, and the whole bug report is about this: when the visible object sets position to the invisible, the invisible object's angle no longer works.

I'll give option 1 a shot though.


#5

Can you post a project link? It's sorta sounds like a bug in your code rather than a Hopscotch bug, but I'd be happy to check.

I suggest to recategorize this as Debug My Code until others confirm which case it is.


#6

Ahhh.

There was a bug in my code, but I don't think I altered it myself. The arctan positions were set to the wrong text, but as I exited the project it might've somewhat changed code. I'm pretty sure that I didn't select the wrong text X and y positions

I did shuffle and rename some texts, and this may have glitched the system changing text references.

Sorry for the inconvenience.


#7

Adding onto that i have an extremely slow editor so I was copying and pasting blocks that were nearly duplicates and it could've changed through that.


#8

Glad you found the bug :smiley: