ERROR: attempt to perform arithmetic (add) on Vector3 and number, how to solve the problem?#2

Who can help solve the problem with the engine, I do not know what the problem is, added vector3 no result, still writes this error


1 Like

The issue is that you’re dividing the arguments in the functions (Vector3s) by numbers and then adding them. Essentially, you’re doing this:

(, n, n) / n) + n 
--^^^  Vector3 + n
-- You cannot add a number to a Vector3

Can you fix that for me, I didn’t quite understand what you wrote.

In other words, the code shown looks dated as it uses userdata to detect a Vector3. Change "userdata" to "vector"

You can do that, I would be very grateful.