So i want like a part to print like this one in the image but how?
Also please give me a simple script of it.
So i want like a part to print like this one in the image but how?
Also please give me a simple script of it.
Hey,
the dev forum is a place to learn scripting and get assistance with your code, talk about development topics, report a studio bug and so on, but not give you a full script just like that.
We can’t give you a full script and this is misuse.
Im sorry, im just don’t what line is it used for it >((((
You should check out the Touched Event BasePart.Touched. There are many ways to do this so this is just one of the simpler options.
its not collision its a vision im sorry for making it a misunderstanding.
Edit: You might have to change some of the code yourself to meet your needs.
Do you want something like a field of view? If yes I made a post recently about it:
No i just want it like if its like this, then it will print nothing
however if its like this then print something
Oh I see. Try using :GetPartBoundsInBox() then. WorldRoot:GetPartBoundsInBox Using CFrame.LookVector, UpVector, and RightVector should give you the corners.
If the object you’re trying to detect is large enough, you could get away with using raycasts here, but that won’t always be reliable. Using a hitbox might be the best way here, but that will have its own limitations. What are you using this for?
to make the steering straight for my car
i already have left and right steering system all i need is that to make it steer straight when at a certain angle
Wait, so then why do you need to see forward? Can’t you just use the car’s existing direction of movement to calculate where forwards is?
well yeah, thats why i need a system where a side part has a angle that makes steering straight because of this.
if dot < 0 then
print(“turn left”)
script.Parent.Steer = -1
elseif dot > 0 then
print(“turn right”)
script.Parent.Steer = 1
end