Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Carl Findahl
IMT3601 Game Programming Project
Commits
78646ac8
Commit
78646ac8
authored
Dec 10, 2019
by
Carl Findahl
💬
Browse files
Fix lever not working on client
parent
e4630540
Changes
4
Hide whitespace changes
Inline
Side-by-side
Content/Viking/Blueprints/Interaction/BP_Lever.uasset
LFS
View file @
78646ac8
No preview for this file type
Content/Viking/Maps/TestLevel.umap
LFS
View file @
78646ac8
No preview for this file type
Source/Viking/Private/InteractableActor.cpp
View file @
78646ac8
...
...
@@ -2,9 +2,16 @@
#include "InteractableActor.h"
#include "UnrealNetwork.h"
// Sets default values
AInteractableActor
::
AInteractableActor
()
{
PrimaryActorTick
.
bCanEverTick
=
false
;
SetReplicates
(
true
);
}
void
AInteractableActor
::
GetLifetimeReplicatedProps
(
TArray
<
FLifetimeProperty
>&
OutLifetimeProps
)
const
{
Super
::
GetLifetimeReplicatedProps
(
OutLifetimeProps
);
DOREPLIFETIME
(
AInteractableActor
,
bActivated
);
}
Source/Viking/Public/InteractableActor.h
View file @
78646ac8
...
...
@@ -35,8 +35,10 @@ public:
UFUNCTION
(
BlueprintCallable
,
BlueprintPure
,
Category
=
"Interaction"
)
const
bool
IsActivated
()
const
{
return
bActivated
;
}
virtual
void
GetLifetimeReplicatedProps
(
TArray
<
FLifetimeProperty
>&
OutLifetimeProps
)
const
override
;
protected:
/** Is the item activated */
UPROPERTY
(
BlueprintReadWrite
,
Category
=
"Interaction"
)
UPROPERTY
(
BlueprintReadWrite
,
Category
=
"Interaction"
,
Replicated
)
bool
bActivated
=
false
;
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment