Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
1 2 3 4 5 … 18 Next »
Reliably getting an entity's velocity clientside.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Reliably getting an entity's velocity clientside.
06-04-2026, 03:39 AM, (This post was last modified: 06-04-2026, 04:00 AM by The17thDoctor. Edited 1 time in total.)
#1
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
Reliably getting an entity's velocity clientside.
So I've been working on a starfall that requires getting an arbitrary entity's velocity no matter how this entity is being moved (whether through "natural" physics movements, drive core, parenting, etc..)

I've tried using the PhysObj:getVelocity() method, however this does not work when the entity is being moved by a drive core for instance.
I then tried to keep the last position of the entity and compare it to the current, however this produced artifacts when I tried doing that. I have theories on why but it's irrelevant to the problem.

I'm really struggling to find a way to reliably get velocity without artifacts of sorts. Is there any way that exists or that could be implemented ?

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
06-04-2026, 10:11 AM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Reliably getting an entity's velocity clientside.
An entity with a parent has no velocity by design, as far as the engine is concerned only the parent is actually moving. Any child entities will have exactly the same velocity, otherwise they wouldn't stay in the same relative position.

If you want the velocity of an entity that has a parent, you need to first resolve its root parent.
Find
Reply
06-04-2026, 06:24 PM,
#3
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Reliably getting an entity's velocity clientside.
The end goal is to be able to calculate the velocity of an entire contraption at specific points.
Given the information you provided, I believe I might be able to use the PhysObj:getVelocityAtPoint() to achieve what I want.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
06-04-2026, 06:43 PM,
#4
The17thDoctor Offline
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: Reliably getting an entity's velocity clientside.
Scrap that, sadly it seems that PhysObj are not always available clientside. Which my project needs.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.