Can someone help me reduce this laggy object

So my hologram object has a proximity that detects for an Anti-Tower, a location where you aren’t able to place towers. But this is incredibly laggy due to all of these Anti-Towers being solid. Can someone help with a way to make them not solid, but still tell the Hologram that it can’t place there?

3 Likes

Hey, can you post some details about how to set things up to get to the laggy bit?

Some general optimization advice for everyone: Step one before attempting to optimize anything should always be to check the performance metrics. That way do don’t waste time working on something that’s not actually your bottleneck.

3 Likes

The perfomance matrix is like 90% objects/ smart objects so it’s a bit vague.
But if you play one of my levels, and when you click to place a tower it makes a hologram, which should make the FPS drop a bit.

2 Likes

Ok, so I’ve played this game before, but it’s been a while and I’m pretty confused about how it all works. I went to the tutorial (1-1) and click start. It gives me a window with two defense options. I click one and nothing happens? I click the other and nothing happens? Then I click go, and the game starts running - I get no defense options to place at the bottom. I’m not sure if it’s not complete, or if I’m just being dumb, but I can’t figure out what’s going on. I don’t see any holograms anywhere.

All that being said, it seems like your intuition was correct - proximity is definitely an issue as you can see in the metrics:

2 Likes

Clicking the defenses didn’t do anything?
OH RIGHT, So I made a change where you have to unlock different towers, and that’s unfinished so at the beginning of every game press (U)
-I changed it so it auto unlocks everything just for now.

1 Like

I see you have a Proximity looking for “=Controller Cursor” with a very large distance - this is probably part of the problem at least. Not sure what that is even doing, but there is probably a better way.

Can you replace that with some different logic?

3 Likes

Raycast could work

1 Like

It seems to not detect it correctly, since the ray-cast doesn’t start in the center

2 Likes

What do you mean? The Raycast behavior always starts from within the center of the detecting object. Do you mind sending a screenshot?

1 Like

I set it up with ray cast, and it doesn’t detect anything

1 Like

That’s probably a bug

1 Like

Are you trying to replace the =Controller Cursor Prox check with a Raycast? If you explain what that logic is doing, I can maybe suggest an alternative (faster) approach

1 Like

The controller cursor is only if you’re playing with a controller, I made it so the switch activates when there is a controller.
But the ray-cast should replace the (Anti-Tower) proximity.

1 Like