#Drag system

1 messages · Page 1 of 1 (latest)

mighty bronze
#

My friend want help fixing their drag system can anyone help fix?

#

Bump

gleaming flare
mighty bronze
mighty bronze
#

@gleaming flare

gleaming flare
#

whats wrong with it

mighty bronze
#

according to my friend who coded it

#

they followed a youtube tutorial

#

SUBSCRIBE!

In this episode of Roblox, LMAG, I show you how I created the Lumber Tycoon 2 Grab ability. I program the script line for line so you can understand what each line is doing, and how it relates to the rest of the script. Programming your own scripts are fun and rewarding. If you are new, I highly recommend checking out my book "The Ad...

▶ Play video
gleaming flare
mighty bronze
#

whats that

#

is that drag coding

gleaming flare
#

it's a roblox built-in component that does 3d dragging

#

much like your script, but without any code

mighty bronze
#

so a built in dragger?

#

i see

#

i will send them this

mighty bronze
#

its gonna be in a lt2 / oaklands style game, so for premade objects it'd work, but for new or genrrated ones it wouldnt.

#

(worded by my friend not me)

gleaming flare
mighty bronze
#

playsession* not pp

#

such as trees or rocks.

gleaming flare
#

you can create them during runtime just fine

mighty bronze
#

if you aarent able to help fix the code then why avt like you have the knowlegde to do such, and the supply us with a fix that wont work for what we need to acheive

earnest monolith
#

he litteraly gave you what u need

mighty bronze
mighty bronze
#

did u evne read the full thread?

earnest monolith
mighty bronze
#

like i said, it doesnt work on stuff that is made an item from model mid gameplay

#

pyro is wrong.

earnest monolith
#

and i just

#

replied

mighty bronze
#

pyro

#

is wrong

earnest monolith
#

and how would u know

mighty bronze
#

because we've tried it????

#

he acted like he could help fix the code but when supplied with it, effectiveky told us to get rid of it.

earnest monolith
#

he doesnt act

#

he tells you his opinion

#

2nd off

#

you have search engines like google

#

ai that suck at coding

#

but can help you

#

people are just a last option if u dont understand a single thing

gleaming flare
#

i just finished reading your code and there's all sorts of problems with it

#

starting with the fact it's a localscript and you're trying to apply forces to replicated parts.

#

meaning, you're trying to move parts that, in all likelihood, will belong to the server.

#

that's why the parts don't move for a start.

earnest monolith
#

ive seen in natural disaster

#

that exploiters

#

are able to move

#

parts

#

in a circle

#

arent exploits client sided?

#

if thats it how are

#

they abl eto do it

mighty bronze
#

the item will be server sided, yeah, becuase its a r

#

an open world exploration tycoon.

#

if a game did it 10 years ago and still has their code working then clearly the 'only option' isnt a drag detector???

earnest monolith
#

and knows how to update his script

#

up to date

mighty bronze
#

at all

earnest monolith
#

or someting

mighty bronze
#

lt2's code is severely outdated

earnest monolith
mighty bronze
#

it still works

#

draggng, chopping the lot.

earnest monolith
#

because its gonna update

#

to make it better

#

old functions may get removed

#

but replaced with better ones

#

and defaultio aint that dum

mighty bronze
fathom ridgeBOT
#

studio** You are now Level 3! **studio

earnest monolith
#

maybe big updates ok

#

but event items

#

security measures

#

are still being added

mighty bronze
earnest monolith
#

aswell as new trees

mighty bronze
#

hardly an update

earnest monolith
#

take 2024 update

#

changes in sizde

mighty bronze
gleaming flare
#

as for why the ball isn't moving, setting aside you're using deprecated features BodyPosition and BodyGyro, that's probably coming from the weld weldBetween(DragBall,GrabObject) which then goes back to the first problem (the server-owned part doesn't move), and also happens to be using another deprecated feature, ManualWeld. your math for the movement of the ball looks fine, so i'm pretty sure it's the weld.

earnest monolith
#

also take the recent anti cheat measures

#

lets people not colide with items

gleaming flare
earnest monolith
#

resulting in no flinging and stuff

earnest monolith
mighty bronze
#

and how does someone fix the 'weld'

#

and 'depriciated features'

earnest monolith
mighty bronze
#

which refers to some issues which break the code

#

and im asking what we'd do to fix it

gleaming flare
#

it has all the same features as your code, is more stable, and replicates to the server automatically.

#

not to mention, it is cross-platform compatible, whereas your binding to mouse1 means it only works on pc. dragdetector works on all platforms.

mighty bronze
gleaming flare
#

also looks like there's a fun edge case in your code where the ball has collisions enabled, so it'll collide with the mouse ray. should be fine between the ball and the part though because of the weld.

mighty bronze
#

here, speak to the owner of the game @spark parcel when they can speak after 10 minutes

gleaming flare
#

yeah idk why you were asking on their behalf to start with

mighty bronze
#

because they make all finalised choices, i was just the middlewoman whist they tried to fixicstuff on their end

earnest monolith
gleaming flare
mighty bronze
earnest monolith
#

but no middle man

#

just me

#

i am both experimenting and making posts

#

unless im bored and im playing roadblocks

mighty bronze
mighty bronze
earnest monolith
#

you can seek out advice from roblox studio docs

#

ai

#

stuff like that

#

not just rely on humans

mighty bronze
#

and im sorry she didnt know about this server already????

mighty bronze
earnest monolith
mighty bronze
#

the whole point of making our own script is so we dont have to resort too support of ai

plucky thistle
#

instead of complaining

earnest monolith
mighty bronze
earnest monolith
earnest monolith
#

how can it generate code

#

but steal from thousands

mighty bronze
#

ai learnt how to code by scanning and extracting from tens of thousands OR MORE people

earnest monolith
#

take chatgpt for example

#

u can toggle search on internet

mighty bronze
plucky thistle
mighty bronze
#

it can extract from everywhere, even here or dms

plucky thistle
#

code can't be stolen what are you on about

#

even if you were to steal it

earnest monolith
mighty bronze
plucky thistle
#

you wouldn't know how to use it

mighty bronze
#

what was it

#

hundered thousand games thqt got taken down in 2020 for stealing defauliutos code

plucky thistle
#

code isn't like models and gui

mighty bronze
#

didnt steal???

earnest monolith
mighty bronze
earnest monolith
#

from line 1 to the end

mighty bronze
#

take woodmil inc for an examole

#

got removed for using lt2's tree genration code

spark parcel
#

Okay then.

plucky thistle
spark parcel
#

Hello "Coders".

plucky thistle
#

change the lines a bit

mighty bronze
#

so u guys arw a bunch of ai using prats, and not coders is what im getting.

spark parcel
#

loosely because you people don't even touch code and just let AI do everything for you..

earnest monolith
plucky thistle
plucky thistle
earnest monolith
spark parcel
#

the whole REASON i made this script off a tutorial was BECAUSE i didnt want to use ai or the toolbox.

spark parcel
#

i was learning from it at the very least.

earnest monolith
#

UNLESS YOU CREATE WHOLE GAMES FROM IT

gleaming flare
spark parcel
#

you'd know a lot about that, wouldnt you?

plucky thistle
earnest monolith
spark parcel
#

getting things done? what a joke..

gleaming flare
#

instead of skidding off 4 year old outdated tutorials that evidently don't work properly fingerguns

plucky thistle
#

you wouldn't use ai, if you don't know how to code

mighty bronze
earnest monolith
#

HATE AI

#

FOR NO REASON

#

LIKE YO

#

U

#

it LITTERALY

spark parcel
#

because it steals from other creators? hence artists?

earnest monolith
#

helped me ALOT

spark parcel
#

you.

earnest monolith
mighty bronze
#

MAKE ONE WORKING PEICE OF CODE WITHOUT ANY Ai IMPUT THEN
IF ITS SO EASY

spark parcel
#

yes, actually

earnest monolith
mighty bronze
spark parcel
#

loads of cases of ai getting credit for source material

plucky thistle
spark parcel
#

oh you poor soul

earnest monolith
#

and this

plucky thistle
plucky thistle
earnest monolith
#

i feel like people know the diffrence which one is which

#

"art" is something that ai cant trully recreate as of right now

plucky thistle
#

Look ai is an effeciency tool, if you don't know how to use its your problem

earnest monolith
#

generate full on piccaso type shii

plucky thistle
#

and ai doesn't steal code

#

its generates it

gleaming flare
#

anyway it seems like they came here just to get people to fix their code for free rather than for getting help, so that's me out

earnest monolith
#

i agree why did i even come here i need to fix my own problem

gleaming flare
#

keep calm and make games fingerguns

plucky thistle
#

so how your guys' day been

mighty bronze
# earnest monolith

you are comparing an ancient painter with skill unrivalled from all of history to a meta ai image.

plucky thistle
mighty bronze
#

meta ai is one of the lowest quality ai generators.

mighty bronze
#

are u that stupid

plucky thistle
mighty bronze
#

i did

#

im asking u a quesrion

plucky thistle
#

bro, if you don't want to use ai

#

then don't

#

stop the yap

#

nah im out fr this time

mighty bronze
#

if u want this planet to live

#

dont use ai

gleaming flare
gleaming flare
earnest monolith
#

@mighty bronze btw proof that ai helps

#

from my previous post

#

i couldnt figure out

#

how to get my saving to work correctly

#

and ai helped me to do it

#

turns out i was saving stuff incorrectly

spark parcel
#

though i dont know how it works exactly, i wanted a script that ran locally off the player, which that tutorial provided

#

every unanchored object in the game can be dragged in theory

earnest monolith
#

can you send me the script

#

the full on script

spark parcel
#

it's above i believe

gleaming flare
spark parcel
#

sigh

gleaming flare
#

its fine, i recall most of it

spark parcel
#

it isnt their fault, the reason they sent it instead of me was because i couldnt actually talk yet

#

in addition i also couldnt get to the script and copy it (i have a terrible computer)

#

which is also why i wanted to make it work so badly. it took hours to actually make because of my current situation.

fathom ridgeBOT
#

studio** You are now Level 1! **studio

spark parcel
#

i didnt just want that work to go down the drain for a simple toggle that would yes, be more effective cross platform, but be more complicated to apply to say, a lumber tycoon style game

earnest monolith
#

try this

#

not sure if it will work at all

earnest monolith
gleaming flare
earnest monolith
#

@gleaming flare you shouldnt put stuff in hyper links

#

moderators dont appreciate that much sometimes

#

and people think its another free steam giftcard

spark parcel
#

its a lot more ambitious than just a lumber game, i wont spoil it, but if i can pull it off despite my lack of coding knowledge..

gleaming flare
earnest monolith
#

i gave u possibly working code

spark parcel
#

its a mix of every game, ever. islands, flight, cargo,

#

and yes, i know!

earnest monolith
#

did it work tho

fathom ridgeBOT
#

studio** You are now Level 13! **studio

spark parcel
#

remember i have really slow hardware..

#

itll take a moment

earnest monolith
#

lmk if it works

spark parcel
#

it takes 20 seconds to open the file explorer.. on a good day.

earnest monolith
#

make sure to ping me

spark parcel
#

so..

#

testing now..

#

aaaaand it does the same thing as the first one.

#

uh..

gleaming flare
gleaming flare
spark parcel
#

for me it REFUSES to work 😭 hold on

gleaming flare
earnest monolith
spark parcel
#

kms 🔥

#

half of it was surprisingly similar to my script

#

source material who

#

vineboom.mp3

gleaming flare
earnest monolith
#

@gleaming flare

#

he left the post

gleaming flare
#

i'm aware

earnest monolith
#

@spark parcel call ur freind back over here and prove him that ai is useful (dont make it a rage bait)

#

he wont be happy if it is

#

im not meaning to make this a ragebait btw

gleaming flare
spark parcel
#

we know ai is useful, we never said it wasnt

#

our argument is you don't really learn anything from it

#

it's a soulless algorithm

#

it can, granted, be used to correct errors in existing code

#

but to generate it all from nothing from words? we considered that the easy way out.

fathom ridgeBOT
#

studio** You are now Level 2! **studio

spark parcel
#

it is useful and has its applications in certain scenarios,

#

but for what it is i want to learn through experience, not rely on a program to do my work for me. that ruins the whole point in my eyes

#

teach a man how to fish kind of concept, you know?

gleaming flare
# spark parcel uh..

for the record you can sometimes move parts because sometimes the client has network ownership and sometimes not.

#

the new script has the same problem, you need remote events to make it replicate properly hehe

spark parcel
#

dies

#

why can't dragdetector apply to the player when the mouse hits an unanchored part?

#

is that even possible?

#

like that would solve a lot of problems, but to what i know i cant apply it to a player, only to a part

#

it would be a universal script, not a ton of drag detectors

gleaming flare
#

if you tried i suspect you'd have to double click on it which would be weird

spark parcel
#

which i imagine would cause a lot of lag

gleaming flare
#

though, you wouldnt need to care about the drag script

spark parcel
#

like imagine like 200 bricks all with dragdetector on

#

to be fair 200 bricks by themselves would cause stupid amounts of lag

gleaming flare
#

you may be able to make a drag detector on click if you do it early enough in the frame like with bindtorenderstep

spark parcel
#

but still

gleaming flare
#

i haven't tested it though

spark parcel
#

and then like.. delete it afterwards?

spark parcel
#

like once the mouse releases it deletes that instance of dragdetector?

gleaming flare
spark parcel
#

hmm..

gleaming flare
#

then your only code is managing the dragdetector instead of the actual functions of dragging stuff, applying force etc, it's instead wrapped up in a neat package

spark parcel
#

wouldnt it need an initial drag detector to sense WHEN you're dragging though? like as a trigger?

gleaming flare
#

lol clickdetector

spark parcel
#

i swear i will sob

#

and what does click detector apply to

gleaming flare
#

srsly having 1000 click detectors + drag detectors isn't as expensive as you might think

spark parcel
#

true, but would it not be neater to just have a brick of code for every unanchored item?

#

instead of like 1000 detectors on every item?

gleaming flare
spark parcel
#

itd look a little messy

gleaming flare
spark parcel
#

also fun fact: the game i intend to make is supposed to be hyper performant

gleaming flare
#

if you're going to unanchor something give it a drag detector

spark parcel
#

like.. insanely optimized. anyone could play it.

#

thats what i aim for

#

i cant cut corners here in this situation..

#

i have to assume anything can cause lag

#

the whole reason i even want to make a game is because the game i play currently is laggy, unoptimized, and the devs dont listen to the players

#

i want to make a community that accepts all despite specs and interests

gleaming flare
spark parcel
#

you can fish and itd be so high quality you could tell someone it was a specifically fishing game

#

or mining, or chopping trees,

gleaming flare
spark parcel
#

or exploring the sky islands..

#

server lag, sandbox game

#

they refuse to fix it because it doesnt make them significant income

#

apparently only 3% of their income is from mobile/weak devices

#

so they, in their eyes, have no incentive to optimize

gleaming flare
#

what kind of lag

#

describe a very specific example

spark parcel
#

like 2 fps on both 1 graphics bar and 10. no difference.

#

every other game is fine. games of similar genres are 60 fps usually.

gleaming flare
#

you sure it's fps?

spark parcel
#

it has an fps counter..

#

lag gets significantly worse with more players,

#

and even when starting out, there isnt a textureless mode or something to reduce lag

#

coupled with the sheer amount of exposed faces that constantly check for collision, cars flinging..

fathom ridgeBOT
#

studio** You are now Level 3! **studio

spark parcel
#

it is a mess.

gleaming flare
#

next time you play it, take note of the level of recv in the f7 overlay. if it's any higher than 150~200 then you should expect lag.

gleaming flare
#

there's not really a way to fix it.

spark parcel
#

true, but the thing is it's like.. NO other sandbox games like you have this lag. WHY are we lagging here?

#

similar concepts, similar mechanics,

#

the game i'm talking about is oaklands by the way.. and i'm comparing to lt2 and rc2

#

it has terrible performance compared to the 2

gleaming flare
#

either way you shouldn't worry about performance too much until your game actually has a performance problem

spark parcel
#

true, but then you'd have to find WHY its lagging.

#

in my eyes i'd want to make sure from the START everything is as lagless as i can possibly make it.

gleaming flare
#

roblox has tonnes of debugging tools

gleaming flare
#

besides

spark parcel
#

that is certainly a way to graph performance

#

speed of light as a measurement is bonkers

gleaming flare
#

the only way to know how some code will perform is to benchmark it.

spark parcel
#

also why is a whale a measurement in terms of light (yes i know its a scale to give an idea of how to comprehend the number but its just funny to me)

gleaming flare
#

if you're working on something you think will be expensive, then stress test it and find out

spark parcel
#

good idea.. im just worried in the end i'll make something that only certain people can play, or that itll work but itll be a slideshow

#

yes, i worry too much. yes, thats a flaw of mine

#

i just dont want to invest hours into something that wont work.

gleaming flare
spark parcel
#

cough..... drag script. cough.

#

still cheesed about my og script tho.. who knows, maybe i can just take from the toolbox and make a rough model of the game (very rough), and then refine it later

#

considering the one i got doesnt have rotation, or distance modding

gleaming flare
spark parcel
#

(moving further and closer with shift and scrollwheel)

gleaming flare
#

except a few structural changes to make it flow a bit better

#

easier to read etc

spark parcel
#

but my old one didnt work?..

#

😭

gleaming flare
#

it did

spark parcel
#

erm

#

for me it just

gleaming flare
spark parcel
#

worked for a split second and stopped

#

nono wait let me explain

#

it worked, but it was complicated

gleaming flare
spark parcel
#

it worked for a second, and weirder, it PARTIALLY worked

#

when grabbing an object, it held on and rotated it to match the rotation of the player relative to where they grab from

gleaming flare
#

yeah i've messed with local parts being constrained to server owned parts, it gets pretty jank. in summary, don't do it.

spark parcel
#

it then just.. held the dragball where it was. sob. so wheere and HOW do i fix it? is there a specific place/folder i need to put it, or to make it just a script and NOT a localscript?

gleaming flare
#

this has been explained many times

spark parcel
#

nono, i get dont make it local, im just trying to get things straight

#

is it JUST a script?

#

does that fix my problem?

gleaming flare
spark parcel
#

this is all going over my head.

fathom ridgeBOT
#

studio** You are now Level 4! **studio

gleaming flare
spark parcel
#

nothing, we're just good friends

gleaming flare
# spark parcel it then just.. held the dragball where it was. sob. so wheere and HOW do i fix i...

i start to tune out when a conversation devolves into 'wHeRe Do I pUt ThAt' so uh best advice i can give you is to either hire someone who knows what they're doing to help you out, or learn for yourself https://create.roblox.com/docs/tutorials/fundamentals/coding-1/coding-fundamentals. no one here is going to go out of their way to write code for you because most are working on their own projects. help is diagnostics and direction, not free code.

spark parcel
#

no, what im asking is.. HOW did it work for you, and not me? thats all

#

i'm not asking for you to develop my game..

#

im just curious how i messed it up that badly

gleaming flare
# spark parcel no, what im asking is.. HOW did it work for you, and not me? thats all

i put their script in starterplayerscripts and it just worked out of the box as expected. critical fact is, as expected. i expected it to not work consistently on server parts, only when i'm near them, and work flawlessly on clientsided parts, which is exactly what was shown. (i had to click twice on the local part since the first click was sunk on focusing the game window)

spark parcel
#

kms, i put it in starterCHARACTERscripts.

gleaming flare
spark parcel
#

erm

#

confuzzled

gleaming flare
# earnest monolith

though this probably is better placed in startercharacterscripts tbh because of local character = player.Character or player.CharacterAdded:Wait() which would stop it working if the player dies once

gleaming flare
gleaming flare
#

that's why... hire someone who knows what they're doing ;o

#

anyway good luck with things salute

gusty cradle
#

@gleaming flare Theres so many messages that I'm confused but I would like to have a drag - system, can you sum up how you do it from your experience because i did not understand anything frm the arugment above

gleaming flare
gusty cradle
#

holy 10k

plucky thistle
#

instead of having 10k

#

but if its too complicated then what pyrofire said should od the trick

gleaming flare
#

...but that was the original problem hehe

plucky thistle
#

if he is able to do this remote event finicky stuff it'd be much better

#

but ig, if he can't really code the drag detectors will do

gleaming flare
plucky thistle
#

and when the player stop dragging the part, just fire the same remote event and remove the dragdetector

gleaming flare
#

then you get input delay and most likely need to click twice ;p

plucky thistle
#

but its either that or loading 10k drag detectors

plucky thistle
#

you could just fire the remote event

#

when the player is hovering over the part

gleaming flare
#

their original would work fine all they had to do was fire a remote and tell the server to give network ownership, that's it.

#

and obv you need one that strips network ownership when its dropped

#

technically exploitable but if you make this limit to 1~2 parts and distance check, and validity check (player cannot pickup the ground), then you're good fingerguns but they dont know how to do that

plucky thistle
#

if were taking his coding ability into consideration