What's the equivalent to Distance3D for two Vec3D points?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
hideousdestructor
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

What's the equivalent to Distance3D for two Vec3D points?

Post by hideousdestructor »

I keep forgetting what it's supposed to be or if such a thing even exists.

Keeping in mind I'm trying to make this portal-friendly so just subtracting them is not good enough...

EDIT: Right, it was level.vec3offset(v1,v2). Was just assigning the result to a pointer marked for something else...
User avatar
phantombeta
Posts: 2225
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: What's the equivalent to Distance3D for two Vec3D points

Post by phantombeta »

level.Vec3Offset adds the vectors together - the equivalent to Distance3D would be "level.Vec3Diff (v1, v2).Length ()".

Return to “Scripting”