Comments (6)
For the Panel.Tick you are supposed to be grabbing input from the Player class, Panel.Tick runs every frame while Player.Tick runs every update, which is why Input.Pressed is firing multiple times. The solution for this if you're creating a menu is to create static controls for your class and call those methods through Player Tick.
As for Player.Tick, input gets checked on both client and server, perhaps try checking for IsClient or IsServer before doing whatever you're trying to do?
from sbox-issues.
Inside Panel.Tick
I was using Player.Local.Input
and static fields to access them. I also surrounded everything with IsClient and it still wasn't working.
from sbox-issues.
You have to use Player.Tick is what I'm saying though, if you get Player input through Panel tick it's going to get called multiple times
from sbox-issues.
I tried both Player.Tick & Panel.Tick and both were unreliable for remote players, while Player.Tick was at least reliable for the local player.
from sbox-issues.
Player.Tick should be, and is in my experience, 100% reliable.
Player.Tick is only called clientside for the local player. If it's being called clientside for remote players then there's something going wrong.
from sbox-issues.
In BasePlayer class:
protected override void Tick()
{
if ( IsClient )
{
using ( Prediction.Off() )
{
if ( Input.Pressed( InputButton.Score ) )
{
InventoryPage.Instance.ToggleInventory();
Log.Info( "Pressed" );
}
else if ( Input.Released( InputButton.Score ) )
{
Log.Info( "Released" );
}
}
}
}
As you can see it fires off Pressed and Released events multiple times in a row. It doesnt matter if IsClient
is first or Prediction.Off()
is first, or if Prediction.Off()
is removed.
from sbox-issues.
Related Issues (20)
- Mesh Editor - Invert Selection HOT 1
- Mesh Editor - Material Drag Replace
- Rename `Collision other` to `Collision collision` in CollisionListener methods
- Make line renderer take a list of vector3s or automatically network it. HOT 5
- Overflow-X only Scrollable with mousewheel not with Leftclick or rightclick
- Missing Sky Texture Breaks Map Loading HOT 3
- Expose map object in a way that allows replacement of them HOT 2
- Legacy Light Probes Should Not Render Dynamically HOT 1
- Include org and game description in search? HOT 2
- API Search is not including everything as it should HOT 2
- Models in SkinnedModelRenderer vanishing under certain circumstances
- Cubemaps no longer have a way to exclude objects from them
- Set `Collider.IsTrigger = true` during the first frame is ignoring Collision settings HOT 1
- Scene Change does close Server HOT 1
- Prefab guids regenerating HOT 2
- When changing the model of skinned renderer during runtime, the animations stop working HOT 3
- Stop All Sounds on a specific Mixer
- Add Pause functionality to SoundHandle HOT 1
- Gameobject fails to deserialize properties that target objects inside bone hierarchies HOT 1
- UI Sounds should automatically attempt to be routed through the "UI" Mixer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbox-issues.