Linear Velocity, PlaneVelocity glitching and deleting parts

Just curious, but do you know what is destroying them? (Like did you do that yourself, or is there some other issue?)

I don’t know how to explain it but its like the part goes past height limit and gets destroyed. I did not do it myself and it stems from PlaneVelocity which is linear velocity

I see.

I am not very familiar with all the goofy velocity things roblox has, but perhaps try printing the values that you’re using (CFrames, vectors) to see if any of them are going crazy.

1 Like

Wait actually

do you think the issue might be due to you clicking on the unit itself?

yea it happens when i right click aka move the unit EXACTLY where its position is.

i tried this. It gets deleted before it can even be printed lol. weridly enough its still stored in the selected units table

Where are you printing it? you should print the values before they’re actually used to move the unit.

i just figured something out atm though. When i right click the unit it signals to attack itself. Attacking uses cframe.lookat so maybe if its looking at itself and multiplying against itself it is flinging it out of bounds.

yep this was the issue. Thank you SO SO SO MUCH! for the inital part. The getting the Z of the model worked and mixed with not attacking itself no more errors. Thank you.

1 Like

(idk if you’d want to know this but additional info anyways, I would assume that the lookat is breaking because its trying to do tan(0/0) to find the angle)

Its looking at the models primary part for the inital vector3 value then looking at the target’s primary position then + some vector3 values to keep them on a 2d plane. Having a unit look at itself is just bad from the start. I literally had to edit one line which was

old:
if unit.UnitStats.TEAM ~= TEAM then
m.Event("Attack")

new:
if unit.UnitStats.TEAM.Value ~= TEAM then
m.Event("Attack")

some quality of life improvements would be making movement less stutterish. as in the video it stutters. I could be wrong but could stem from the movement being server instead of client. But we will see. Saved my RTS game. Thank you.

1 Like

Try looking on the server tab after telling the unit to move. If its also stuttery there, it might be another problem, otherwise, you could just send the unit’s final location to all the clients, and have them also move the unit to achieve a smoother movement. (Idk how you’d deal with replication though, its definitely possible since people seem to do that alot of the times)

my scripts are in a spider web but i have a system that does client and server replication at the same time. like oddly server sided projectiles look like client sided cause of this system**. What did you mean by server tab btw?**

(whats a spider web lol)

I don’t think you should be replicating everything on the client to the server nor vice versa (Atleast not manually, since roblox should already do that). What I meant was that you want the client to be moving the objects itself instead of waiting for the server to update its position.

By the server tab, I mean that button on the top right corner of the “Test” section which either says “Client” or “Server” which allows you to switch between server-view and client-view.

gottcha. DW the system has no FPS drops when 187 units are on screen. MAYBE a ping spike from a memory leak i need to fix teehee

it is late for me so ill test the Client or server view tomorrow. Thanks again for the help. Apperciate it much

1 Like

I tried this right now. Server tab has no stutter but client does.

1 Like

This means its just replication lag. Send the target location to the client and have the client move the thing itself instead of having the server move it.

Specifically how you would make the server-to-client replication not mess that up, I don’t really know

edit: this topic probably has some solutions to that Humanoid movement replication delays - #3 by SkrubDaNub

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.