![]() ![]() And the green glowing brick is going in front of my AI because latency and thus the 5 inch problem.įinal Method | Calculating it’s speed to counter latency In this video shown below, I am using a very fast SuperTick ( faster than RunService entirely) and CFraming/Positioning the green glowing brick to the AIs’ HumanoidRootPart. If you switched to the ServerSide you’ll probably and most likely see that your projectile is going the desired direction properly. ![]() Looking at your video of your problem, you’re viewing from the ClientSide. My AIs :NetworkOwnership() is currently set to nil and yet it is still having latency issues. I do have a theory to your problem and final method in mind. I appreciate you clearing my mind and making me understand a lot better. ![]() If you have any questions or things aren’t clear enough, please do not hesitate to ask ( via private messaging which I’d prefer or not). Method #3 | Scuff-it-out-and-hope-for-the-bestīasically, when your loop is done or projectile is close enough to the head, just Position/CFrame it to the enemies head. Kind of like what Method #1 is doing, it’s just tweening to one CFrame that’s not being updated. Projectile.CFrame = projectile.CFrame:Lerp(SavedTargetCFrame,i) -// Use the SavedCFrame instead of updating the targets CFrame every. Local SavedTargetCFrame = -// Save targets CFrame We should save the TargetCFrame and use it from there like so local target = findNearestTarget(newTower) Method #2 | Not making the projectile trackīasically what I’m saying is, instead of CFraming/Positioning the projectile with an always updated TargetCFrame ( which your script is currently doing). TweenService:Create(projectile, PositionTweenInfo, ):Play() Local target = findNearestTarget(newTower) Local CalculatedSpeed = (PositionA-PositionB).Magnitude / Speed local TweenService = game:GetService("TweenService") Some calculation like this I think ( I’m not good at math) (PositionA-PositionB).Magnitude / Speed. Which also applies if the enemy is close, the projectile would go at a snails pace. And thus, is probably the cause of the 5 inch problem thing.ĭo some speed and time calculations so the projectile doesn’t go zooming at mach 5 if the enemy is far away. Also sorry to pry, but your projectiles are acting like tracking ( or homing) projectiles ( considering it as a slingshot) which isn’t that realistic since you keep updating its ( the projectiles’) CFrame towards the enemies’ head while the enemies’ head CFrame keeps updating, if you know what I mean. He maintains a variety of Clojure and ClojureScript projects on Github, usually focusing on developer tools and games.I hope I am understanding your problem/situation correctly as it is currently midnight and I have three method/ideas to possibly fix your problem best as possible. Zach teaches Java and Clojure at The Iron Yard in Charleston, SC. Presentation Slides (as a game) Source Code This event was generously hosted by the College of Charleston's Computer Science Department. Zach walks you through writing games in a functional programming language that features:Īll in ClojureScript, a functional language that runs in web browsers, and play-cljs, a game library written for it. The vast majority of games today, from the small indie variety up to triple-A titles, are written in a mostly standard way, filled with mutable variables and large object hierarchies. While functional programming is making huge inroads in areas like web development and distributed computing, there is one kind of software where its use is still rare: games.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |